Internet censorship -where I live- has almost turned web unusable so I decided to setup a transparent proxy using Tor for my home network. ince Tor is so slow -here- proxying all traffic through Tor would slow my connection to a crawl. Therefore I need a mechanism to selectively proxy the traffic.
I know a bit of 'iptables' and it looks to me like the solution to my problem. However there's a trick. As most of the websites I need to access through Tor (like Google+, Facebook and such) use several IP addresses for their entry points, it's almost impossible for me to add 'iptables' rules for all of those IP addresses. I need a mechanism to proxy the traffic based on URL patterns. For example I need to be able to proxy access to '*.facebook.com' through Tor.
So the question boils down to: how can I setup a system-wide transparent proxy using URL patterns?
Any idea/hint is much appreciated.