astro / socksify-ruby

Redirect any TCP connection initiated by a Ruby script through a SOCKS5 proxy
http://socksify.rubyforge.org/
Other
165 stars 79 forks source link

Add localhost to default ignores #9

Closed leonid-shevtsov closed 13 years ago

leonid-shevtsov commented 13 years ago

I suggest that localhost (127.0.0.1) should be added to the default TCPSocket.socks_ignores list.

The reasons for that are: a) specifically, Tor will not proxy local requests, which breaks any interaction with a local TCP server (Redis, for example) b) generally, it's nonsensical to proxy a request to localhost for any purposes other than debugging.

For googlers: this is the error message I was getting with Tor + Socksify + Redis:

[notice] No Tor server allows exit to [scrubbed]:6379. Rejecting.
[warn] Your application (using socks5 to port 6379) is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead. For more information, please see http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#SOCKSAndDNS