I have a setup where I have 2 proxy servers. One is a socks proxy which I wish to use for ALL connections by default. The second proxy is an http proxy which I wish to use for http connections to specific hosts (all on the same domain(s))
Lets assume:
- Socks proxy is hostA:9000
- Http proxy is hostB:8080
- Domain that should go through http proxy is *.foobar.com
Can iptables be configured to do this?
For the socks proxy you can use a utility called
tun2socks
(thats a link). It basically sets up a tunnel device which you can create routing rules to tunnel your traffic through. I use this for connecting to my network at work (since the proprietary vpn software on linux is crap). It works just fine with a few quirks (most notable is that it works for TCP only).For the http proxy. In theory this should be possible, but I've never done it myself. However nixcraft has a howto, and their stuff is usually pretty good.