C# Class apophis.SharpIRC.StarkSoftProxy.HttpProxyClient

HTTP connection proxy class. This class implements the HTTP standard proxy protocol.

You can use this class to set up a connection to an HTTP proxy server. Calling the CreateConnection() method initiates the proxy connection and returns a standard System.Net.Socks.TcpClient object that can be used as normal. The proxy plumbing is all handled for you.

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 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.

HttpProxyClient ( ) : System

Constructor.

HttpProxyClient ( TcpClient tcpClient ) : System

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

HttpProxyClient ( string proxyHost ) : System

Constructor. The default HTTP proxy port 8080 is used.

HttpProxyClient ( string proxyHost, int proxyPort ) : System

Constructor.

Private Methods

Method Description
CreateAsyncWorker ( ) : void
CreateConnectionAsync_DoWork ( object sender, DoWorkEventArgs e ) : void
CreateConnectionAsync_RunWorkerCompleted ( object sender, RunWorkerCompletedEventArgs e ) : void
HandleProxyCommandError ( string host, int port ) : void
ParseCodeAndText ( string line ) : void
ParseResponse ( string response ) : void
SendConnectionCommand ( string host, int port ) : void
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 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.
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 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 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

HttpProxyClient() public method

Constructor.
public HttpProxyClient ( ) : System
return System

HttpProxyClient() public method

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

HttpProxyClient() public method

Constructor. The default HTTP proxy port 8080 is used.
public HttpProxyClient ( string proxyHost ) : System
proxyHost string Host name or IP address of the proxy.
return System

HttpProxyClient() public method

Constructor.
public HttpProxyClient ( string proxyHost, int proxyPort ) : System
proxyHost string Host name or IP address of the proxy server.
proxyPort int Port number for the proxy server.
return System