Linux has tsocks and proxychains which override the connect() method with a LD_PRELOAD library and force traffic to go through a socks proxy. Easier than iptables since at least proxychains can be installed with apt-get on Ubuntu(don't know about other OSes).
Only problem with the LD_PRELOAD method is that it doesn't work for all (many) apps. I believe one case it breaks for is non blocking connect()s, not sure if there are others. Although the iptables setup is a lot more complicated it pretty much works for everything.
Re:Secure your browsing using a home VPN
by keeperofdakeys on Sunday August 07, 2011 @11:11PM
(#2858604)
An example I have found is rtorrent. There is also https://github.com/apenwarr/sshuttle, which looks promising, but I haven't used it. My vps provider doesn't provide tap for openvpn to work.
The easiest way around this is VPN, but you can also do crazier stuff like use ProxyCap (for windows or OSX) or iptables redirect/transocks setup in Linux: http://coderrr.wordpress.com/2009/07/29/how-to-force-flash-o...