socat icon indicating copy to clipboard operation
socat copied to clipboard

socks5 localDNS feature

Open gits7r opened this issue 6 years ago • 0 comments

Hi, Thanks for this super useful patch. Socks5 support for socat was desperately needed, and this patch socat does the job perfectly fine. I can't understand how until now the official socat does not support socks5, but it's good that this patch allows you to do it.

I was thinking about the DNS resolving part, sometimes we want not to send the hostname to be resolved at socks5 server end in case they are censored or something. For socks4, socat allows you to set socks4: if you want to resolve the DNS locally, where socat is running, or socks4a: if you want to resolve the DNS at the socks proxy end.

It would be nice if we had for socks5 with auth an option like: socks5localdns=yes (which defaults to no of course if unset) that will allow the server running socat to resolve the DNS locally and send to the proxy the command to connect to the raw ip address directly. Example:

let's say example.com resolves to just A record 10.0.0.1

socat .... socks5:127.0.0.1:example.com:80,socks5port=7777

  • this will send example.com DNS name to be resolved at socks5 127.0.0.1 server

socat .... socks5:127.0.0.1:example.com:80,socks5port=7777,socks5localdns=yes

  • this will resolve example.com DNS name locally and send the command to the socks5 server 127.0.0.1 to directly connect to 10.0.0.1

gits7r avatar Oct 26 '19 10:10 gits7r