C# Class apophis.SharpIRC.StarkSoftProxy.Socks5ProxyClient

Socks5 connection proxy class. This class implements the Socks5 standard proxy protocol.
This implementation supports TCP proxy connections with a Socks v5 server.
Inheritance: IProxyClient
ファイルを表示 Open project: FreeApophis/sharpIRC

Public Methods

Method Description
CancelAsync ( ) : void

Cancels any asychronous operation that is currently active.

CreateConnection ( string destinationHost, int destinationPort ) : TcpClient

Creates a remote TCP connection through a proxy server to the destination host on the destination port.

This method creates a connection to the proxy server and instructs the proxy server to make a pass through connection to the specified destination host on the specified port.

CreateConnectionAsync ( string destinationHost, int destinationPort ) : void

Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port.

This method instructs the proxy server to make a pass through connection to the specified destination host on the specified port.

Socks5ProxyClient ( ) : System

Create a Socks5 proxy client object.

Socks5ProxyClient ( TcpClient tcpClient ) : System

Creates a Socks5 proxy client object using the supplied TcpClient object connection.

Socks5ProxyClient ( string proxyHost ) : System

Create a Socks5 proxy client object. The default proxy port 1080 is used.

Socks5ProxyClient ( string proxyHost, int proxyPort ) : System

Create a Socks5 proxy client object.

Socks5ProxyClient ( string proxyHost, int proxyPort, string proxyUserName, string proxyPassword ) : System

Create a Socks5 proxy client object.

Socks5ProxyClient ( string proxyHost, string proxyUserName, string proxyPassword ) : System

Create a Socks5 proxy client object. The default proxy port 1080 is used.

Private Methods

Method Description
CreateAsyncWorker ( ) : void
CreateConnectionAsync_DoWork ( object sender, DoWorkEventArgs e ) : void
CreateConnectionAsync_RunWorkerCompleted ( object sender, RunWorkerCompletedEventArgs e ) : void
DetermineClientAuthMethod ( ) : void
GetDestAddressBytes ( byte addressType, string host ) : byte[]
GetDestAddressType ( string host ) : byte
GetDestPortBytes ( int value ) : byte[]
HandleProxyCommandError ( byte response, string destinationHost, int destinationPort ) : void
NegotiateServerAuthMethod ( ) : void
SendCommand ( byte command, string destinationHost, int destinationPort ) : void

Method Details

CancelAsync() public method

Cancels any asychronous operation that is currently active.
public CancelAsync ( ) : void
return void

CreateConnection() public method

Creates a remote TCP connection through a proxy server to the destination host on the destination port.
This method creates a connection to the proxy server and instructs the proxy server to make a pass through connection to the specified destination host on the specified port.
public CreateConnection ( string destinationHost, int destinationPort ) : TcpClient
destinationHost string Destination host name or IP address of the destination server.
destinationPort int Port number to connect to on the destination host.
return System.Net.Sockets.TcpClient

CreateConnectionAsync() public method

Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port.
This method instructs the proxy server to make a pass through connection to the specified destination host on the specified port.
public CreateConnectionAsync ( string destinationHost, int destinationPort ) : void
destinationHost string Destination host name or IP address.
destinationPort int Port number to connect to on the destination host.
return void

Socks5ProxyClient() public method

Create a Socks5 proxy client object.
public Socks5ProxyClient ( ) : System
return System

Socks5ProxyClient() public method

Creates a Socks5 proxy client object using the supplied TcpClient object connection.
public Socks5ProxyClient ( TcpClient tcpClient ) : System
tcpClient System.Net.Sockets.TcpClient A TcpClient connection object.
return System

Socks5ProxyClient() public method

Create a Socks5 proxy client object. The default proxy port 1080 is used.
public Socks5ProxyClient ( string proxyHost ) : System
proxyHost string Host name or IP address of the proxy server.
return System

Socks5ProxyClient() public method

Create a Socks5 proxy client object.
public Socks5ProxyClient ( string proxyHost, int proxyPort ) : System
proxyHost string Host name or IP address of the proxy server.
proxyPort int Port used to connect to proxy server.
return System

Socks5ProxyClient() public method

Create a Socks5 proxy client object.
public Socks5ProxyClient ( string proxyHost, int proxyPort, string proxyUserName, string proxyPassword ) : System
proxyHost string Host name or IP address of the proxy server.
proxyPort int Port used to connect to proxy server.
proxyUserName string Proxy authentication user name.
proxyPassword string Proxy authentication password.
return System

Socks5ProxyClient() public method

Create a Socks5 proxy client object. The default proxy port 1080 is used.
public Socks5ProxyClient ( string proxyHost, string proxyUserName, string proxyPassword ) : System
proxyHost string Host name or IP address of the proxy server.
proxyUserName string Proxy authentication user name.
proxyPassword string Proxy authentication password.
return System