Introduction
The download contains a C# source file that defines a SocksProxy
class. This class can be used by the hosts, which are behind a firewall to connect to the outside world.
Description
When a TCP-based client wishes to establish a connection to an object that is reachable only via a firewall and that firewall speaks SOCKS5 protocol, this class can used on the client side to reach the object via firewall. The SOCKS service is conventionally located on TCP port 1080.
This class provides only a single static method named ConnectToSocks5Proxy
, which accepts required arguments and returns a socket connected to the destination endpoint. If something wrong happens, it throws a ConnectionException
. This version only supports "connect" command. "Bind" and "UDP" is not supported in this version.
For details about SOCKS5 RFC visit: http://www.faqs.org/rfcs/rfc1928.html
Client usage
Socket client;
client = LMKR.SocksProxy.ConnectToSocks5Proxy(
"172.16.64.145",1080,"www.microsoft.com",
80,"U$er","Pa$$word!");
string strGet = "GET //\r\n";
s.Send(System.Text.Encoding.ASCII.GetBytes(strGet));