C# Class Halibut.Transport.Proxy.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
Exibir arquivo Open project: OctopusDeploy/Halibut

Public Methods

Method Description
CreateConnection ( string destinationHost, int destinationPort, System.TimeSpan timeout ) : 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.

HttpProxyClient ( ILog logger, string proxyHost, int proxyPort, string proxyUserName, string proxyPassword ) : System

Constructor.

WithTcpClientFactory ( Func tcpClientfactory ) : IProxyClient

Private Methods

Method Description
EncodeTo64 ( string toEncode ) : string
GetConnectCmd ( string host, int port ) : string
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

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, System.TimeSpan timeout ) : TcpClient
destinationHost string Destination host name or IP address.
destinationPort int Port number to connect to on the destination host.
timeout System.TimeSpan Timeout duration for the Connect attempt.
return System.Net.Sockets.TcpClient

HttpProxyClient() public method

Constructor.
public HttpProxyClient ( ILog logger, string proxyHost, int proxyPort, string proxyUserName, string proxyPassword ) : System
logger ILog
proxyHost string Host name or IP address of the proxy server.
proxyPort int Port number for the proxy server.
proxyUserName string Proxy authentication user name.
proxyPassword string Proxy authentication password.
return System

WithTcpClientFactory() public method

public WithTcpClientFactory ( Func tcpClientfactory ) : IProxyClient
tcpClientfactory Func
return IProxyClient