C# Класс 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.

Наследование: IProxyClient
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

CreateConnection() публичный Метод

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.
Результат System.Net.Sockets.TcpClient

HttpProxyClient() публичный Метод

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.
Результат System

WithTcpClientFactory() публичный Метод

public WithTcpClientFactory ( Func tcpClientfactory ) : IProxyClient
tcpClientfactory Func
Результат IProxyClient