C# Class apophis.SharpIRC.StarkSoftProxy.Socks4ProxyClient

Socks4 connection proxy class. This class implements the Socks4 standard proxy protocol.
This class implements the Socks4 proxy protocol standard for TCP communciations.
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 TCP connection to the destination host through the proxy server host.

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 using the supplied open TcpClient object with an open connection to proxy server.

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

Socks4ProxyClient ( ) : System

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

Socks4ProxyClient ( TcpClient tcpClient ) : System

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

Socks4ProxyClient ( string proxyHost ) : System

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

Socks4ProxyClient ( string proxyHost, int proxyPort ) : System

Create a Socks4 proxy client object.

Socks4ProxyClient ( string proxyHost, int proxyPort, string proxyUserId ) : System

Create a Socks4 proxy client object.

Socks4ProxyClient ( string proxyHost, string proxyUserId ) : System

Create a Socks4 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
GetDestinationPortBytes ( int value ) : byte[]

Translate the destination port value to a byte array.

GetIPAddressBytes ( string destinationHost ) : byte[]

Translate the host name or IP address to a byte array.

HandleProxyCommandError ( byte response, string destinationHost, int destinationPort ) : void

Receive a byte array from the proxy server and determine and handle and errors that may have occurred.

SendCommand ( NetworkStream proxy, byte command, string destinationHost, int destinationPort, string userId ) : void

Sends a command to the proxy server.

WaitForData ( NetworkStream stream ) : void

Method Details

CancelAsync() public method

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

CreateConnection() public method

Creates a TCP connection to the destination host through the proxy server host.
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 server.
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 using the supplied open TcpClient object with an open connection to proxy server.
This 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

Socks4ProxyClient() public method

Create a Socks4 proxy client object. The default proxy port 1080 is used.
public Socks4ProxyClient ( ) : System
return System

Socks4ProxyClient() public method

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

Socks4ProxyClient() public method

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

Socks4ProxyClient() public method

Create a Socks4 proxy client object.
public Socks4ProxyClient ( 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

Socks4ProxyClient() public method

Create a Socks4 proxy client object.
public Socks4ProxyClient ( string proxyHost, int proxyPort, string proxyUserId ) : System
proxyHost string Host name or IP address of the proxy server.
proxyPort int Port used to connect to proxy server.
proxyUserId string Proxy user identification information.
return System

Socks4ProxyClient() public method

Create a Socks4 proxy client object. The default proxy port 1080 is used.
public Socks4ProxyClient ( string proxyHost, string proxyUserId ) : System
proxyHost string Host name or IP address of the proxy server.
proxyUserId string Proxy user identification information.
return System