I have been searching for a solution to notify the browser on user that the request is Rejected so stop loading it. Because I have blocked facebook and every page that have a facebook plugin is stacked at loading for 1 min, leading in confusion.
When I use this rule:
iptables -A FORWARD -p tcp -m iprange --src-range192.168.1.50-192.168.1.100 --dport 443 -j REJECT.
I have to add this code
--reject-with tcp-resetto do the request below, so the browser was noticed instantly for the rejection and didn't wait in loading any more.
Now my question is how can I do the same with this new rule I have added recently that block facebook using L7 information?
iptables -A FORWARD -m string --string "facebook.com" --algo bm --from 1 --to 600 -j REJECT
The blocking part work very well but the problem is that the hole pages that contains any facebook plugin or part stay in loading for +5 sec without interrupting any work on main page, only that the load symbol on browser tab lead to misunderstanding on user experience