ProxySocket Class
Namespace: Rebex.Net
Assembly: Rebex.Networking.dll (version 7.0.9448)
Implements the subset of the Berkeley sockets interface; adds the ability to connect through SOCKS4/SOCKS5 and HTTP proxies.
Syntax
public class ProxySocket : ISocketExt, ISocket, IDisposable
Inherited Members
Remarks
This class is suitable for extending your client applications with the ability to connect through proxies.
This class is limited to operations supported by proxies - it is not a replacement for the Socket. This means it is perfect for writing clients, but useless for writing servers.
Only connection-oriented protocols are supported at the moment
Constructors
| Name | Description |
|---|---|
| ProxySocket() | Initializes an empty instance of the ProxySocket class. |
| ProxySocket(Proxy) | Initializes a new instance of ProxySocket class with parameters provided in the supplied Proxy object. |
| ProxySocket(Socket) | Initializes a new instance of the ProxySocket class based on the specified socket. |
Properties
| Name | Description |
|---|---|
| AuthenticationMethod | Gets the authentication method to use for HTTP CONNECT proxy. NTLM authentication is only supported by some HTTP CONNECT proxies. |
| Available | Gets the amount of data that has been received from the network and is available to be read. |
| Connected | Gets a value that indicates whether the ProxySocket is connected to a remote host as of the last Send or Receive operation. |
| Domain | Gets the domain to submit to the proxy server for authentication. |
| Handle | Gets the operating system handle for the inner Socket. |
| Information | Gets socket information on the underlying socket object. |
| LocalEndPoint | Gets the local endpoint. |
| LocalPortRange | Gets the local TCP port range to which to bind the connections. |
| Password | Gets the username to submit to the proxy server for authentication. Password authentication is not supported by SOCKS4 and SOCKS4a. |
| ProxyHost | Gets the hostname of the proxy server. |
| ProxyPort | Gets the port of the proxy server. |
| ProxyType | Gets the type of the proxy server. |
| ReceiveBufferSize | Gets or sets receive buffer size. Must be set before calling the Connect(String, Int32) method. |
| RemoteEndPoint | Gets the remote endpoint. |
| SendBufferSize | Gets or sets send buffer size. Must be set before calling the Connect(String, Int32) method. |
| Socket | Gets the internal Socket value. |
| Timeout | Gets or sets the length of time in milliseconds before the operation times out (specify -1 or 0 to indicate that the request does not time out which is default). |
| UserName | Gets the username to submit to the proxy server for authentication. |
Methods
| Name | Description |
|---|---|
| Accept() | Accepts an incoming connection. |
| BeginAccept(AsyncCallback, Object) | Begins an asynchronous request to accept an incoming connection. |
| BeginConnect(EndPoint, AsyncCallback, Object) | Begins an asynchronous request for a connection to a network device. |
| BeginConnect(String, Int32, AsyncCallback, Object) | Begins an asynchronous request for a connection to a network device. |
| BeginListen(ISocket, AsyncCallback, Object) | Starts an asynchronously request to listen for an incoming connection using the specified control socket as a base. |
| BeginReceive(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object) | Begins to asynchronously receive data from a connected ProxySocket. |
| BeginSend(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object) | Sends data asynchronously to a connected ProxySocket. |
| Bind(Socket) | Binds this ProxySocket instance to a connected Socket. |
| Close() | Forces the ProxySocket connection to close. |
| Connect(EndPoint) | Establishes a connection to a remote device. |
| Connect(String, Int32) | Establishes a connection to a remote device. |
| Dispose() | Disposes the object. |
| EndAccept(IAsyncResult) | Ends an asynchronous request to accept an incoming connection. |
| EndConnect(IAsyncResult) | Ends a pending asynchronous connection request. |
| EndListen(IAsyncResult) | Ends an asynchronous request to listen for an incoming connection. |
| EndReceive(IAsyncResult) | Ends a pending asynchronous read. |
| EndSend(IAsyncResult) | Ends a pending asynchronous send. |
| GetConnectionState() | Gets a value that indicates whether the ProxySocket is currently connected to a remote host. |
| IsValidHost(String) | Checks whether the host address is a valid hostname or IP address. |
| Listen(ISocket) | Starts a request to listen for an incoming connection using the specified control socket as a base. |
| Poll(Int32, SocketSelectMode) | Determines the status of the socket. |
| Receive(Byte[]) | Receives data from a connected ProxySocket. |
| Receive(Byte[], Int32, Int32) | Receives the specified amount of data from a connected ProxySocket into a specific location of the receive buffer and using the supplied flags. |
| Receive(Byte[], Int32, Int32, SocketFlags) | Receives the specified amount of data from a connected ProxySocket into a specific location of the receive buffer and using the supplied flags. |
| Receive(Byte[], Int32, SocketFlags) | Receives the specified amount of data from a connected ProxySocket using the supplied flags. |
| Receive(Byte[], SocketFlags) | Receives data from a connected ProxySocket using the supplied flags. |
| Send(Byte[]) | Sends data to a connected ProxySocket. |
| Send(Byte[], Int32, Int32) | Sends the specified amount of data to a connected ProxySocket starting at the indicated location in the data and using the supplied flags. |
| Send(Byte[], Int32, Int32, SocketFlags) | Sends the specified amount of data to a connected ProxySocket starting at the indicated location in the data and using the supplied flags. |
| Send(Byte[], Int32, SocketFlags) | Sends the specified amount of data to a connected ProxySocket using the supplied flags. |
| Send(Byte[], SocketFlags) | Sends data to a connected ProxySocket using the supplied flags. |
| Shutdown(SocketShutdown) | Disables sends and receives on the ProxySocket. |
| ToEndPoint(IPHostEntry, Int32) | Chooses the most appropriate IP endpoint to use from the host entry. |
| ToEndPoint(String, Int32) | Converts the host address and port into an IP endpoint. If the host address is not an IP address, returns null. |