How do i use socat as a proxy server?
Solution 1:
You didn't specify the destination host which you want to connect to through the SOCKS server. I've used google.com
on port 80 in this example.
socat TCP-LISTEN:1234,fork SOCKS4A:127.0.0.1:google.com:80,socksport=5678
The TCP-LISTEN
address is the port to listen on for connections from the .NET application. 1234
is obviously the port number, and the fork
option allows multiple connections to be made. The SOCKS4A
address is the SOCKS server and destination host to connect to. (If you don't want the SOCKS server to do DNS resolution change SOCKS4A
to SOCKS4
.) 127.0.0.1
is the address of the SOCKS server, and the socksport
option specifies the port of the SOCKS server. google.com:80
is the destination host and port to ask the SOCKS server to connect to.