ComponentSpace.Proxy

ComponentSpace Proxy Class Library Reference

ComponentSpace.Proxy Namespace

The ComponentSpace.Proxy namespace provides simplified access to proxy client classes that can be used to communicate to HTTP, SOCKS v4, SOCKS v4A and SOCKS v5 proxy servers.

It supports outbound TCP connections through these types of proxy servers.

The ProxyClientFactory class includes a method for creating a proxy client of the specified type.

The IProxyClient interface enables accessing the proxy client classes in a standard manner.

Namespace hierarchy

Classes

Class | Description
ConnectCompletedEventArgs | Provides data for the ConnectCompleted event.
ProxyClientBase | The base class for proxy clients.
ProxyClientFactory | The factory class for creating proxy clients.
ProxyException | The exception that is thrown when an Proxy operation fails.
ProxySettings | The proxy settings.

Interfaces

Interface | Description
IProxyClient | The IProxyClient interface provides a generic interface for accessing proxy client classes.

Delegates

Delegate | Description
ConnectCompletedEventHandler | Represents the method that will handle the ConnectCompleted event.

Enumerations

Enumeration | Description
ProxyType | The proxy type.


ConnectCompletedEventArgs Class

Provides data for the ConnectCompleted event.

For a list of all members of this type, see ConnectCompletedEventArgs Members.

System.Object
System.EventArgs
ComponentSpace.Proxy.ConnectCompletedEventArgs

[Visual Basic]
Public Class ConnectCompletedEventArgs
Inherits EventArgs
[C#]
public class ConnectCompletedEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The ConnectCompleted event is raised by the IProxyClient. It contains all the information needed to complete the asynchronous connect operation.

Requirements

Namespace: ComponentSpace.Proxy

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ConnectCompletedEventArgs Members | ComponentSpace.Proxy Namespace


ConnectCompletedEventArgs Members

ConnectCompletedEventArgs overview

Public Instance Properties

AsyncResult Gets the result of the asynchronous connect operation.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ConnectCompletedEventArgs Class | ComponentSpace.Proxy Namespace


ConnectCompletedEventArgs Properties

The properties of the ConnectCompletedEventArgs class are listed below. For a complete list of ConnectCompletedEventArgs class members, see the ConnectCompletedEventArgs Members topic.

Public Instance Properties

AsyncResult Gets the result of the asynchronous connect operation.

See Also

ConnectCompletedEventArgs Class | ComponentSpace.Proxy Namespace


ConnectCompletedEventArgs.AsyncResult Property

Gets the result of the asynchronous connect operation.

[Visual Basic]
Public ReadOnly Property AsyncResult As IAsyncResult
[C#]
public System.IAsyncResult AsyncResult {get;}

Property Value

An IAsyncResult that contains the data associated with the connect operation.

Remarks

AsyncResult identifies ongoing or completed asynchronous operations. The property contains data that helps determine which of several potential asynchronous operations to complete, and when passed to the event handler, enables EndConnect to access the status associated with the completed operation.

See Also

ConnectCompletedEventArgs Class | ComponentSpace.Proxy Namespace


ConnectCompletedEventHandler Delegate

Represents the method that will handle the ConnectCompleted event.

[Visual Basic]
Public Delegate Sub ConnectCompletedEventHandler( _
ByVal sender As Object, _
ByVal e As ConnectCompletedEventArgs _
)
[C#]
public delegate void ConnectCompletedEventHandler(
object sender,
ConnectCompletedEventArgs e
);

Parameters

sender
The source of the event.
e
A ConnectCompletedEventArgs that contains the event data.

Remarks

When you create a ConnectCompletedEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

Requirements

Namespace: ComponentSpace.Proxy

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy Namespace


IProxyClient Interface

The IProxyClient interface provides a generic interface for accessing proxy client classes.

For a list of all members of this type, see IProxyClient Members.

[Visual Basic]
Public Interface IProxyClient
[C#]
public interface IProxyClient

Types that implement IProxyClient

Type | Description
HttpProxyClient | The HttpProxyClient permits connections to be made through an HTTP proxy server.
ProxyClientBase | The base class for proxy clients.
Socks4Client | The Socks4Client permits connections to be made through a SOCKS 4/4A proxy server.
Socks5Client | The Socks5Client permits connections to be made through a SOCKS 5 proxy server.

Requirements

Namespace: ComponentSpace.Proxy

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

IProxyClient Members | ComponentSpace.Proxy Namespace


IProxyClient Members

IProxyClient overview

Public Instance Properties

ReceiveTimeout | Gets or sets the number of milliseconds to wait for the response from the proxy server.
SendTimeout | Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.
SynchronizingObject | Gets or sets the synchonizing object for receiving events.

Public Instance Methods

BeginConnect | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect | Completes the specified asynchronous connect operation.

Public Instance Events

ConnectCompleted Occurs when the connect has completed.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient Properties

The properties of the IProxyClient interface are listed below. For a complete list of IProxyClient interface members, see the IProxyClient Members topic.

Public Instance Properties

ReceiveTimeout | Gets or sets the number of milliseconds to wait for the response from the proxy server.
SendTimeout | Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.
SynchronizingObject | Gets or sets the synchonizing object for receiving events.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient.ReceiveTimeout Property

Gets or sets the number of milliseconds to wait for the response from the proxy server.

[Visual Basic]
Property ReceiveTimeout As Integer
[C#]
int ReceiveTimeout {get; set;}

Property Value

The number of milliseconds to wait for the response from the proxy server.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient.SendTimeout Property

Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.

[Visual Basic]
Property SendTimeout As Integer
[C#]
int SendTimeout {get; set;}

Property Value

The number of milliseconds to wait for the request to be sent to the proxy server.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient.SynchronizingObject Property

Gets or sets the synchonizing object for receiving events.

[Visual Basic]
Property SynchronizingObject As ISynchronizeInvoke
[C#]
System.ComponentModel.ISynchronizeInvoke SynchronizingObject {get; set;}

Property Value

An ISynchronizeInvoke, which represents the object that marshals the event-handler call resulting from a ConnectCompleted event. The default is a null reference (Nothing in Visual Basic).

Remarks

A ConnectCompleted event results from a BeginConnect request to a specific thread. Typically, the SynchronizingObject is set when it's used within a form, because forms are bound to a specific thread.

Typically, the synchronizing object marshals a method call into a single thread.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient Methods

The methods of the IProxyClient interface are listed below. For a complete list of IProxyClient interface members, see the IProxyClient Members topic.

Public Instance Methods

BeginConnect | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect | Completes the specified asynchronous connect operation.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


BeginConnect Method

ComponentSpace Proxy Class Library Reference

IProxyClient.BeginConnect Method

Initiates an asynchronous connect operation.

Overload List

Initiates an asynchronous connect operation.

IAsyncResult BeginConnect(string,int,string,string);

Initiates an asynchronous connect operation that has a specified state object.

IAsyncResult BeginConnect(string,int,string,string,object);

Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.

IAsyncResult BeginConnect(string,int,string,string,object,AsyncCallback);

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient.BeginConnect Method (String, Int32, String, String)

Initiates an asynchronous connect operation.

[Visual Basic]
Function BeginConnect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String _
) As IAsyncResult
[C#]
IAsyncResult BeginConnect(
string serverAddress,
int serverPort,
string userName,
string password
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user ID or null.
password
The password or null.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Remarks

In asynchronous processing, you use BeginConnect to raise the ConnectCompleted event when the connect operation has completed.

To use BeginConnect, create an event handler that processes the results of the asynchronous operation and associate it with your event delegate. BeginConnect initiates an asynchronous connect operation; the ProxyClientBase is notified, through the raising of the ConnectCompleted event, when the connect operation is completed. The ProxyClientBase can then access the connect status by calling EndConnect.

Note: The BeginConnect method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginConnect is asynchronous, you can call it to receive the connect status without blocking the current thread of execution. To synchronously connect, use the Connect method.

Once an asynchronous operation completes, you can call BeginConnect again in the event handler to keep receiving notifications.

The IAsyncResult that BeginConnect returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndConnect is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace | IProxyClient.BeginConnect Overload List


IProxyClient.BeginConnect Method (String, Int32, String, String, Object)

Initiates an asynchronous connect operation that has a specified state object.

[Visual Basic]
Function BeginConnect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String, _
ByVal stateObject As Object _
) As IAsyncResult
[C#]
IAsyncResult BeginConnect(
string serverAddress,
int serverPort,
string userName,
string password,
object stateObject
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user ID or null.
password
The password or null.
stateObject
A state object, specified by the application, that contains information associated with the asynchronous operation.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Remarks

In asynchronous processing, you use BeginConnect to raise the ConnectCompleted event when the connect operation has completed.

Use this overload to associate information with the operation that will be preserved throughout the operation's lifetime. The event handler can detect this information by looking at the AsyncState of the IAsyncResult that is associated with the operation.

To use BeginConnect, create an event handler that processes the results of the asynchronous operation and associate it with your event delegate. BeginConnect initiates an asynchronous connect operation; the ProxyClientBase is notified, through the raising of the ConnectCompleted event, when the connect operation is completed. The ProxyClientBase can then access the connect status by calling EndConnect.

Note: The BeginConnect method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginConnect is asynchronous, you can call it to receive the connect status without blocking the current thread of execution. To synchronously connect, use the Connect method.

Once an asynchronous operation completes, you can call BeginConnect again in the event handler to keep receiving notifications.

The IAsyncResult that BeginConnect returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndConnect is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

The state object associates state information with the operation. For example, if you call BeginConnect multiple times to initiate multiple operations, you can identify each operation through a separate state object that you define.

You can also use the state object to pass information across process threads. If a thread is started but the callback is on a different thread in an asynchronous scenario, the state object is marshaled and passed back along with information from the event.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace | IProxyClient.BeginConnect Overload List


IProxyClient.BeginConnect Method (String, Int32, String, String, Object, AsyncCallback)

Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.

[Visual Basic]
Function BeginConnect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String, _
ByVal stateObject As Object, _
ByVal asyncCallback As AsyncCallback _
) As IAsyncResult
[C#]
IAsyncResult BeginConnect(
string serverAddress,
int serverPort,
string userName,
string password,
object stateObject,
AsyncCallback asyncCallback
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user ID or null.
password
The password or null.
stateObject
A state object, specified by the application, that contains information associated with the asynchronous operation.
asyncCallback
The AsyncCallback that will receive the notification of the asynchronous operation completion.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Remarks

When you use this overload, the callback specified in the callback parameter is invoked directly when the connect operation has completed; the ConnectCompleted event is not raised. The other overloads of BeginConnect rely on this component to raise the ConnectCompleted event.

To use BeginConnect, define an asynchronous callback method. BeginConnect initiates an asynchronous connect operation; the ProxyClientBase is notified, through a call to the callback method, when the connect operation is completed. The ProxyClientBase can then access the connect status by calling EndConnect.

Use this overload to associate information with the operation that will be preserved throughout the operation's lifetime. The event handler can detect this information by looking at the AsyncState of the IAsyncResult that is associated with the operation.

Note: The BeginConnect method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginConnect is asynchronous, you can call it to receive the connect status without blocking the current thread of execution. To synchronously connect, use the Connect method.

Once an asynchronous operation completes, you can call BeginConnect again in the event handler to keep receiving notifications.

The IAsyncResult that BeginConnect returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndConnect is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

The state object associates state information with the operation. For example, if you call BeginConnect multiple times to initiate multiple operations, you can identify each operation through a separate state object that you define.

You can also use the state object to pass information across process threads. If a thread is started but the callback is on a different thread in an asynchronous scenario, the state object is marshaled and passed back along with information from the event.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace | IProxyClient.BeginConnect Overload List


IProxyClient.Connect Method

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String _
) As TcpClient
[C#]
TcpClient Connect(
string serverAddress,
int serverPort,
string userName,
string password
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user ID or null.
password
The password or null.

Return Value

The TcpClient to use to communicate with the destination server.

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient.EndConnect Method

Completes the specified asynchronous connect operation.

[Visual Basic]
Function EndConnect( _
ByVal asyncResult As IAsyncResult _
) As TcpClient
[C#]
TcpClient EndConnect(
IAsyncResult asyncResult
);

Parameters

asyncResult
The IAsyncResult that identifies the asynchronous connect operation to finish, and from which to retrieve an end result.

Return Value

The TcpClient to use to communicate with the destination server.

Remarks

When the ConnectCompleted event is raised, EndConnect completes the operation that was initiated by the BeginConnect call.

Exceptions

Exception Type | Condition
ProxyException | Thrown when the connection fails.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient Events

The events of the IProxyClient interface are listed below. For a complete list of IProxyClient interface members, see the IProxyClient Members topic.

Public Instance Events

ConnectCompleted Occurs when the connect has completed.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


IProxyClient.ConnectCompleted Event

Occurs when the connect has completed.

[Visual Basic]
Event ConnectCompleted As ConnectCompletedEventHandler
[C#]
event ConnectCompletedEventHandler ConnectCompleted;

Event Data

The event handler receives an argument of type ConnectCompletedEventArgs containing data related to this event. The following ConnectCompletedEventArgs property provides information specific to this event.

Property | Description
AsyncResult | Gets the result of the asynchronous connect operation.

Remarks

BeginConnect is used in asynchronous processing to raise the ConnectCompleted event when the connect has completed.

EndConnect is used to complete the operation initiated by a call to BeginConnect and get connection information when the ConnectCompleted event is raised.

See Also

IProxyClient Interface | ComponentSpace.Proxy Namespace


ProxyClientBase Class

The base class for proxy clients.

For a list of all members of this type, see ProxyClientBase Members.

System.Object
ComponentSpace.Proxy.ProxyClientBase
ComponentSpace.Proxy.Http.HttpProxyClient
ComponentSpace.Proxy.Socks4.Socks4Client
ComponentSpace.Proxy.Socks5.Socks5Client

[Visual Basic]
MustInherit Public Class ProxyClientBase
Implements IProxyClient
[C#]
public abstract class ProxyClientBase : IProxyClient

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ProxyClientBase Members | ComponentSpace.Proxy Namespace


ProxyClientBase Members

ProxyClientBase overview

Public Instance Properties

ReceiveTimeout | Gets or sets the number of milliseconds to wait for the response from the proxy server.
SendTimeout | Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.
SynchronizingObject | Gets or sets the synchonizing object for receiving events.

Public Instance Methods

BeginConnect | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect | Completes the specified asynchronous connect operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ConnectCompleted Occurs when the connect has completed.

Protected Instance Constructors

ProxyClientBase Constructor Constructs a ProxyClientBase .

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase Constructor

Constructs a ProxyClientBase .

[Visual Basic]
Protected Sub New( _
ByVal proxyAddress As String, _
ByVal proxyPort As Integer _
)
[C#]
protected ProxyClientBase(
string proxyAddress,
int proxyPort
);

Parameters

proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).
proxyPort
The proxy server port number.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase Properties

The properties of the ProxyClientBase class are listed below. For a complete list of ProxyClientBase class members, see the ProxyClientBase Members topic.

Public Instance Properties

ReceiveTimeout | Gets or sets the number of milliseconds to wait for the response from the proxy server.
SendTimeout | Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.
SynchronizingObject | Gets or sets the synchonizing object for receiving events.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase.ReceiveTimeout Property

Gets or sets the number of milliseconds to wait for the response from the proxy server.

[Visual Basic]
NotOverridable Public Property ReceiveTimeout As Integer _
Implements IProxyClient.ReceiveTimeout
[C#]
public int ReceiveTimeout {get; set;}

Property Value

The number of milliseconds to wait for the response from the proxy server. The default is 60 seconds.

Implements

IProxyClient.ReceiveTimeout

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase.SendTimeout Property

Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.

[Visual Basic]
NotOverridable Public Property SendTimeout As Integer _
Implements IProxyClient.SendTimeout
[C#]
public int SendTimeout {get; set;}

Property Value

The number of milliseconds to wait for the request to be sent to the proxy server. The default is 60 seconds.

Implements

IProxyClient.SendTimeout

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase.SynchronizingObject Property

Gets or sets the synchonizing object for receiving events.

[Visual Basic]
NotOverridable Public Property SynchronizingObject As ISynchronizeInvoke _
Implements IProxyClient.SynchronizingObject
[C#]
public System.ComponentModel.ISynchronizeInvoke SynchronizingObject {get; set;}

Property Value

An ISynchronizeInvoke, which represents the object that marshals the event-handler call resulting from a ConnectCompleted event. The default is a null reference (Nothing in Visual Basic).

Implements

IProxyClient.SynchronizingObject

Remarks

A ConnectCompleted event results from a BeginConnect request to a specific thread. Typically, the SynchronizingObject is set when it's used within a form, because forms are bound to a specific thread.

Typically, the synchronizing object marshals a method call into a single thread.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase Methods

The methods of the ProxyClientBase class are listed below. For a complete list of ProxyClientBase class members, see the ProxyClientBase Members topic.

Public Instance Methods

BeginConnect | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect | Completes the specified asynchronous connect operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


BeginConnect Method

ComponentSpace Proxy Class Library Reference

ProxyClientBase.BeginConnect Method

Initiates an asynchronous connect operation.

Overload List

Initiates an asynchronous connect operation.

public IAsyncResult BeginConnect(string,int,string,string);

Initiates an asynchronous connect operation that has a specified state object.

public IAsyncResult BeginConnect(string,int,string,string,object);

Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.

public IAsyncResult BeginConnect(string,int,string,string,object,AsyncCallback);

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase.BeginConnect Method (String, Int32, String, String)

Initiates an asynchronous connect operation.

[Visual Basic]
NotOverridable Overloads Public Function BeginConnect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String _
) As IAsyncResult _
Implements IProxyClient.BeginConnect
[C#]
public IAsyncResult BeginConnect(
string serverAddress,
int serverPort,
string userName,
string password
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user ID or null.
password
The password or null.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Implements

IProxyClient.BeginConnect

Remarks

In asynchronous processing, you use BeginConnect to raise the ConnectCompleted event when the connect operation has completed.

To use BeginConnect, create an event handler that processes the results of the asynchronous operation and associate it with your event delegate. BeginConnect initiates an asynchronous connect operation; the ProxyClientBase is notified, through the raising of the ConnectCompleted event, when the connect operation is completed. The ProxyClientBase can then access the connect status by calling EndConnect.

Note: The BeginConnect method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginConnect is asynchronous, you can call it to receive the connect status without blocking the current thread of execution. To synchronously connect, use the Connect method.

Once an asynchronous operation completes, you can call BeginConnect again in the event handler to keep receiving notifications.

The IAsyncResult that BeginConnect returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndConnect is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace | ProxyClientBase.BeginConnect Overload List


ProxyClientBase.BeginConnect Method (String, Int32, String, String, Object)

Initiates an asynchronous connect operation that has a specified state object.

[Visual Basic]
NotOverridable Overloads Public Function BeginConnect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String, _
ByVal stateObject As Object _
) As IAsyncResult _
Implements IProxyClient.BeginConnect
[C#]
public IAsyncResult BeginConnect(
string serverAddress,
int serverPort,
string userName,
string password,
object stateObject
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user name or null.
password
The password or null.
stateObject
A state object, specified by the application, that contains information associated with the asynchronous operation.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Implements

IProxyClient.BeginConnect

Remarks

In asynchronous processing, you use BeginConnect to raise the ConnectCompleted event when the connect operation has completed.

Use this overload to associate information with the operation that will be preserved throughout the operation's lifetime. The event handler can detect this information by looking at the AsyncState of the IAsyncResult that is associated with the operation.

To use BeginConnect, create an event handler that processes the results of the asynchronous operation and associate it with your event delegate. BeginConnect initiates an asynchronous connect operation; the ProxyClientBase is notified, through the raising of the ConnectCompleted event, when the connect operation is completed. The ProxyClientBase can then access the connect status by calling EndConnect.

Note: The BeginConnect method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginConnect is asynchronous, you can call it to receive the connect status without blocking the current thread of execution. To synchronously connect, use the Connect method.

Once an asynchronous operation completes, you can call BeginConnect again in the event handler to keep receiving notifications.

The IAsyncResult that BeginConnect returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndConnect is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

The state object associates state information with the operation. For example, if you call BeginConnect multiple times to initiate multiple operations, you can identify each operation through a separate state object that you define.

You can also use the state object to pass information across process threads. If a thread is started but the callback is on a different thread in an asynchronous scenario, the state object is marshaled and passed back along with information from the event.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace | ProxyClientBase.BeginConnect Overload List


ProxyClientBase.BeginConnect Method (String, Int32, String, String, Object, AsyncCallback)

Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.

[Visual Basic]
NotOverridable Overloads Public Function BeginConnect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String, _
ByVal stateObject As Object, _
ByVal asyncCallback As AsyncCallback _
) As IAsyncResult _
Implements IProxyClient.BeginConnect
[C#]
public IAsyncResult BeginConnect(
string serverAddress,
int serverPort,
string userName,
string password,
object stateObject,
AsyncCallback asyncCallback
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user name or null.
password
The password or null.
stateObject
A state object, specified by the application, that contains information associated with the asynchronous operation.
asyncCallback
The AsyncCallback that will receive the notification of the asynchronous operation completion.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Implements

IProxyClient.BeginConnect

Remarks

When you use this overload, the callback specified in the callback parameter is invoked directly when the connect operation has completed; the ConnectCompleted event is not raised. The other overloads of BeginConnect rely on this component to raise the ConnectCompleted event.

To use BeginConnect, define an asynchronous callback method. BeginConnect initiates an asynchronous connect operation; the ProxyClientBase is notified, through a call to the callback method, when the connect operation is completed. The ProxyClientBase can then access the connect status by calling EndConnect.

Use this overload to associate information with the operation that will be preserved throughout the operation's lifetime. The event handler can detect this information by looking at the AsyncState of the IAsyncResult that is associated with the operation.

Note: The BeginConnect method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginConnect is asynchronous, you can call it to receive the connect status without blocking the current thread of execution. To synchronously connect, use the Connect method.

Once an asynchronous operation completes, you can call BeginConnect again in the event handler to keep receiving notifications.

The IAsyncResult that BeginConnect returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndConnect is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

The state object associates state information with the operation. For example, if you call BeginConnect multiple times to initiate multiple operations, you can identify each operation through a separate state object that you define.

You can also use the state object to pass information across process threads. If a thread is started but the callback is on a different thread in an asynchronous scenario, the state object is marshaled and passed back along with information from the event.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace | ProxyClientBase.BeginConnect Overload List


ProxyClientBase.Connect Method

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overridable Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String _
) As TcpClient _
Implements IProxyClient.Connect
[C#]
public virtual TcpClient Connect(
string serverAddress,
int serverPort,
string userName,
string password
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user ID or null.
password
The password or null.

Return Value

The TcpClient to use to communicate with the destination server.

Implements

IProxyClient.Connect

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase.EndConnect Method

Completes the specified asynchronous connect operation.

[Visual Basic]
NotOverridable Public Function EndConnect( _
ByVal asyncResult As IAsyncResult _
) As TcpClient _
Implements IProxyClient.EndConnect
[C#]
public TcpClient EndConnect(
IAsyncResult asyncResult
);

Parameters

asyncResult
The IAsyncResult that identifies the asynchronous connect operation to finish, and from which to retrieve an end result.

Return Value

The TcpClient to use to communicate with the destination server.

Implements

IProxyClient.EndConnect

Remarks

When the ConnectCompleted event is raised, EndConnect completes the operation that was initiated by the BeginConnect call.

Exceptions

Exception Type | Condition
ProxyException | Thrown when the connection fails.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase Events

The events of the ProxyClientBase class are listed below. For a complete list of ProxyClientBase class members, see the ProxyClientBase Members topic.

Public Instance Events

ConnectCompleted Occurs when the connect has completed.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientBase.ConnectCompleted Event

Occurs when the connect has completed.

[Visual Basic]
Public Event ConnectCompleted As ConnectCompletedEventHandler
[C#]
public event ConnectCompletedEventHandler ConnectCompleted;

Event Data

The event handler receives an argument of type ConnectCompletedEventArgs containing data related to this event. The following ConnectCompletedEventArgs property provides information specific to this event.

Property | Description
AsyncResult | Gets the result of the asynchronous connect operation.

Implements

IProxyClient.ConnectCompleted

Remarks

BeginConnect is used in asynchronous processing to raise the ConnectCompleted event when the connect has completed.

EndConnect is used to complete the operation initiated by a call to BeginConnect and get connection information when the ConnectCompleted event is raised.

See Also

ProxyClientBase Class | ComponentSpace.Proxy Namespace


ProxyClientFactory Class

The factory class for creating proxy clients.

For a list of all members of this type, see ProxyClientFactory Members.

System.Object
ComponentSpace.Proxy.ProxyClientFactory

[Visual Basic]
Public Class ProxyClientFactory
[C#]
public class ProxyClientFactory

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ProxyClientFactory Members | ComponentSpace.Proxy Namespace


ProxyClientFactory Members

ProxyClientFactory overview

Public Static (Shared) Methods

CreateProxyClient Overloaded. Creates a proxy client of the specified type.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ProxyClientFactory Class | ComponentSpace.Proxy Namespace


ProxyClientFactory Methods

The methods of the ProxyClientFactory class are listed below. For a complete list of ProxyClientFactory class members, see the ProxyClientFactory Members topic.

Public Static (Shared) Methods

CreateProxyClient Overloaded. Creates a proxy client of the specified type.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ProxyClientFactory Class | ComponentSpace.Proxy Namespace


CreateProxyClient Method

ComponentSpace Proxy Class Library Reference

ProxyClientFactory.CreateProxyClient Method

Creates a proxy client of the specified type.

Overload List

Creates a proxy client of the specified type.

public static IProxyClient CreateProxyClient(ProxySettings);

Creates a proxy client of the specified type.

public static IProxyClient CreateProxyClient(ProxyType,string,int);

See Also

ProxyClientFactory Class | ComponentSpace.Proxy Namespace


ProxyClientFactory.CreateProxyClient Method (ProxySettings)

Creates a proxy client of the specified type.

[Visual Basic]
Overloads Public Shared Function CreateProxyClient( _
ByVal proxySettings As ProxySettings _
) As IProxyClient
[C#]
public static IProxyClient CreateProxyClient(
ProxySettings proxySettings
);

Parameters

proxySettings
The proxy settings.

Return Value

The proxy client.

See Also

ProxyClientFactory Class | ComponentSpace.Proxy Namespace | ProxyClientFactory.CreateProxyClient Overload List


ProxyClientFactory.CreateProxyClient Method (ProxyType, String, Int32)

Creates a proxy client of the specified type.

[Visual Basic]
Overloads Public Shared Function CreateProxyClient( _
ByVal proxyType As ProxyType, _
ByVal proxyAddress As String, _
ByVal proxyPort As Integer _
) As IProxyClient
[C#]
public static IProxyClient CreateProxyClient(
ProxyType proxyType,
string proxyAddress,
int proxyPort
);

Parameters

proxyType
The proxy type.
proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).
proxyPort
The proxy server port number.

Return Value

The proxy client.

See Also

ProxyClientFactory Class | ComponentSpace.Proxy Namespace | ProxyClientFactory.CreateProxyClient Overload List


ProxyException Class

The exception that is thrown when an Proxy operation fails.

For a list of all members of this type, see ProxyException Members.

System.Object
System.Exception
System.ApplicationException
ComponentSpace.Proxy.ProxyException

[Visual Basic]
Public Class ProxyException
Inherits ApplicationException
[C#]
public class ProxyException : ApplicationException

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ProxyException Members | ComponentSpace.Proxy Namespace


ProxyException Members

ProxyException overview

Public Instance Properties

HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message (inherited from Exception) | Gets a message that describes the current exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ProxyException Class | ComponentSpace.Proxy Namespace


ProxySettings Class

The proxy settings.

For a list of all members of this type, see ProxySettings Members.

System.Object
ComponentSpace.Proxy.ProxySettings

[Visual Basic]
Public Class ProxySettings
[C#]
public class ProxySettings

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ProxySettings Members | ComponentSpace.Proxy Namespace


ProxySettings Members

ProxySettings overview

Public Instance Constructors

ProxySettings Constructor Initializes a new instance of the ProxySettings class.

Public Instance Properties

ProxyAddress | Gets or sets the proxy server address.
ProxyPort | Gets or sets the proxy server port.
ProxyType | Gets or sets the proxy type.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ProxySettings Class | ComponentSpace.Proxy Namespace


ProxySettings Constructor

Initializes a new instance of the ProxySettings class.

[Visual Basic]
Public Sub New()
[C#]
public ProxySettings();

See Also

ProxySettings Class | ComponentSpace.Proxy Namespace


ProxySettings Properties

The properties of the ProxySettings class are listed below. For a complete list of ProxySettings class members, see the ProxySettings Members topic.

Public Instance Properties

ProxyAddress | Gets or sets the proxy server address.
ProxyPort | Gets or sets the proxy server port.
ProxyType | Gets or sets the proxy type.

See Also

ProxySettings Class | ComponentSpace.Proxy Namespace


ProxySettings.ProxyAddress Property

Gets or sets the proxy server address.

[Visual Basic]
Public Property ProxyAddress As String
[C#]
public string ProxyAddress {get; set;}

Property Value

The proxy server address.

See Also

ProxySettings Class | ComponentSpace.Proxy Namespace


ProxySettings.ProxyPort Property

Gets or sets the proxy server port.

[Visual Basic]
Public Property ProxyPort As Integer
[C#]
public int ProxyPort {get; set;}

Property Value

The proxy server port.

See Also

ProxySettings Class | ComponentSpace.Proxy Namespace


ProxySettings.ProxyType Property

Gets or sets the proxy type.

[Visual Basic]
Public Property ProxyType As ProxyType
[C#]
public ProxyType ProxyType {get; set;}

Property Value

The proxy type. The default is None.

See Also

ProxySettings Class | ComponentSpace.Proxy Namespace


ProxyType Enumeration

The proxy type.

[Visual Basic]
Public Enum ProxyType
[C#]
public enum ProxyType

Members

Member Name | Description
None | No proxy
Http | HTTP
Socks4 | SOCKS 4
Socks4A | SOCKS 4A
Socks5 | SOCKS 5

Requirements

Namespace: ComponentSpace.Proxy

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy Namespace


ComponentSpace.Proxy.Http

ComponentSpace Proxy Class Library Reference

ComponentSpace.Proxy.Http Namespace

The ComponentSpace.Proxy.Http namespace contains classes that implement the HTTP Connect proxy protocol.

Namespace hierarchy

Classes

Class | Description
HttpProxyClient | The HttpProxyClient permits connections to be made through an HTTP proxy server.


HttpProxyClient Class

The HttpProxyClient permits connections to be made through an HTTP proxy server.

For a list of all members of this type, see HttpProxyClient Members.

System.Object
ComponentSpace.Proxy.ProxyClientBase
ComponentSpace.Proxy.Http.HttpProxyClient

[Visual Basic]
Public Class HttpProxyClient
Inherits ProxyClientBase
[C#]
public class HttpProxyClient : ProxyClientBase

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy.Http

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

HttpProxyClient Members | ComponentSpace.Proxy.Http Namespace


HttpProxyClient Members

HttpProxyClient overview

Public Instance Constructors

HttpProxyClient Overloaded. Initializes a new instance of the HttpProxyClient class.

Public Instance Properties

ReceiveTimeout (inherited from ProxyClientBase) | Gets or sets the number of milliseconds to wait for the response from the proxy server.
SendTimeout (inherited from ProxyClientBase) | Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.
SynchronizingObject (inherited from ProxyClientBase) | Gets or sets the synchonizing object for receiving events.

Public Instance Methods

BeginConnect (inherited from ProxyClientBase) | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Overloaded. Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect (inherited from ProxyClientBase) | Completes the specified asynchronous connect operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ConnectCompleted (inherited from ProxyClientBase) Occurs when the connect has completed.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

HttpProxyClient Class | ComponentSpace.Proxy.Http Namespace


HttpProxyClient Constructor

Initializes a new instance of the HttpProxyClient class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

Overload List

Initializes a new instance of the HttpProxyClient class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

public HttpProxyClient(string);

Initializes a new instance of the HttpProxyClient class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

public HttpProxyClient(string,int);

See Also

HttpProxyClient Class | ComponentSpace.Proxy.Http Namespace


HttpProxyClient Constructor (String)

Initializes a new instance of the HttpProxyClient class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

[Visual Basic]
Overloads Public Sub New( _
ByVal proxyAddress As String _
)
[C#]
public HttpProxyClient(
string proxyAddress
);

Parameters

proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).

Remarks

The proxy server port defaults to 80.

See Also

HttpProxyClient Class | ComponentSpace.Proxy.Http Namespace | HttpProxyClient Constructor Overload List


HttpProxyClient Constructor (String, Int32)

Initializes a new instance of the HttpProxyClient class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

[Visual Basic]
Overloads Public Sub New( _
ByVal proxyAddress As String, _
ByVal proxyPort As Integer _
)
[C#]
public HttpProxyClient(
string proxyAddress,
int proxyPort
);

Parameters

proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).
proxyPort
The proxy server port number.

See Also

HttpProxyClient Class | ComponentSpace.Proxy.Http Namespace | HttpProxyClient Constructor Overload List


HttpProxyClient Methods

The methods of the HttpProxyClient class are listed below. For a complete list of HttpProxyClient class members, see the HttpProxyClient Members topic.

Public Instance Methods

BeginConnect (inherited from ProxyClientBase) | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Overloaded. Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect (inherited from ProxyClientBase) | Completes the specified asynchronous connect operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

HttpProxyClient Class | ComponentSpace.Proxy.Http Namespace


Connect Method

ComponentSpace Proxy Class Library Reference

HttpProxyClient.Connect Method

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

Overload List

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

public TcpClient Connect(string,int);

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

public override TcpClient Connect(string,int,string,string);

See Also

HttpProxyClient Class | ComponentSpace.Proxy.Http Namespace


HttpProxyClient.Connect Method (String, Int32)

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overloads Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer _
) As TcpClient
[C#]
public TcpClient Connect(
string serverAddress,
int serverPort
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.

Return Value

The TcpClient to use to communicate with the destination server.

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

HttpProxyClient Class | ComponentSpace.Proxy.Http Namespace | HttpProxyClient.Connect Overload List


HttpProxyClient.Connect Method (String, Int32, String, String)

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overrides Overloads Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String _
) As TcpClient _
Implements IProxyClient.Connect
[C#]
public override TcpClient Connect(
string serverAddress,
int serverPort,
string userName,
string password
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user name is ignored and should be null.
password
The password is ignored and should be null.

Return Value

The TcpClient to use to communicate with the destination server.

Implements

IProxyClient.Connect

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

HttpProxyClient Class | ComponentSpace.Proxy.Http Namespace | HttpProxyClient.Connect Overload List


ComponentSpace.Proxy.Socks4

ComponentSpace Proxy Class Library Reference

ComponentSpace.Proxy.Socks4 Namespace

The ComponentSpace.Proxy.Socks4 namespace contains classes that implement the SOCKS v4 and SOCKS v4A protocols.

Namespace hierarchy

Classes

Class | Description
Socks4Client | The Socks4Client permits connections to be made through a SOCKS 4/4A proxy server.
Socks4Command | A SOCKS 4/4A command.
Socks4CommandReply | A SOCKS 4/4A command reply.
Socks4ConnectCommand | A SOCKS 4/4A Connect command.

Enumerations

Enumeration | Description
CommandCode | The command code.
ReplyCode | The SOCKS 4 reply codes.


CommandCode Enumeration

The command code.

[Visual Basic]
Public Enum CommandCode
[C#]
public enum CommandCode

Members

Member Name | Description
Connect | Connect

Requirements

Namespace: ComponentSpace.Proxy.Socks4

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy.Socks4 Namespace


ReplyCode Enumeration

The SOCKS 4 reply codes.

[Visual Basic]
Public Enum ReplyCode
[C#]
public enum ReplyCode

Members

Member Name | Description
RequestGranted | Request granted
RequestRejected | Request rejected or failed
RequestRejectedConnectError | Request rejected - SOCKS server connect error
RequestRejectedDifferentUserNames | Request rejected - different user names

Requirements

Namespace: ComponentSpace.Proxy.Socks4

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy.Socks4 Namespace


Socks4Client Class

The Socks4Client permits connections to be made through a SOCKS 4/4A proxy server.

For a list of all members of this type, see Socks4Client Members.

System.Object
ComponentSpace.Proxy.ProxyClientBase
ComponentSpace.Proxy.Socks4.Socks4Client

[Visual Basic]
Public Class Socks4Client
Inherits ProxyClientBase
[C#]
public class Socks4Client : ProxyClientBase

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy.Socks4

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks4Client Members | ComponentSpace.Proxy.Socks4 Namespace


Socks4Client Members

Socks4Client overview

Public Instance Constructors

Socks4Client Overloaded. Initializes a new instance of the Socks4Client class.

Public Instance Properties

ReceiveTimeout (inherited from ProxyClientBase) | Gets or sets the number of milliseconds to wait for the response from the proxy server.
SendTimeout (inherited from ProxyClientBase) | Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.
SynchronizingObject (inherited from ProxyClientBase) | Gets or sets the synchonizing object for receiving events.

Public Instance Methods

BeginConnect (inherited from ProxyClientBase) | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Overloaded. Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect (inherited from ProxyClientBase) | Completes the specified asynchronous connect operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ConnectCompleted (inherited from ProxyClientBase) Occurs when the connect has completed.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Client Constructor

Initializes a new instance of the Socks4Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

Overload List

Initializes a new instance of the Socks4Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

public Socks4Client(string);

Initializes a new instance of the Socks4Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

public Socks4Client(string,int);

Initializes a new instance of the Socks4Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

public Socks4Client(string,int,bool);

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Client Constructor (String)

Initializes a new instance of the Socks4Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

[Visual Basic]
Overloads Public Sub New( _
ByVal proxyAddress As String _
)
[C#]
public Socks4Client(
string proxyAddress
);

Parameters

proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).

Remarks

The proxy server port defaults to 1080. The SOCKS 4 protocol is used.

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace | Socks4Client Constructor Overload List


Socks4Client Constructor (String, Int32)

Initializes a new instance of the Socks4Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

[Visual Basic]
Overloads Public Sub New( _
ByVal proxyAddress As String, _
ByVal proxyPort As Integer _
)
[C#]
public Socks4Client(
string proxyAddress,
int proxyPort
);

Parameters

proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).
proxyPort
The proxy server port number.

Remarks

The SOCKS 4 protocol is used.

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace | Socks4Client Constructor Overload List


Socks4Client Constructor (String, Int32, Boolean)

Initializes a new instance of the Socks4Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

[Visual Basic]
Overloads Public Sub New( _
ByVal proxyAddress As String, _
ByVal proxyPort As Integer, _
ByVal isSocks4A As Boolean _
)
[C#]
public Socks4Client(
string proxyAddress,
int proxyPort,
bool isSocks4A
);

Parameters

proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).
proxyPort
The proxy server port number.
isSocks4A
true if SOCKS v4A, false if SOCKS v4.

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace | Socks4Client Constructor Overload List


Socks4Client Methods

The methods of the Socks4Client class are listed below. For a complete list of Socks4Client class members, see the Socks4Client Members topic.

Public Instance Methods

BeginConnect (inherited from ProxyClientBase) | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Overloaded. Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect (inherited from ProxyClientBase) | Completes the specified asynchronous connect operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace


Connect Method

ComponentSpace Proxy Class Library Reference

Socks4Client.Connect Method

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

Overload List

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

public TcpClient Connect(string,int);

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

public TcpClient Connect(string,int,string);

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

public override TcpClient Connect(string,int,string,string);

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Client.Connect Method (String, Int32)

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overloads Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer _
) As TcpClient
[C#]
public TcpClient Connect(
string serverAddress,
int serverPort
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.

Return Value

The TcpClient to use to communicate with the destination server.

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace | Socks4Client.Connect Overload List


Socks4Client.Connect Method (String, Int32, String)

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overloads Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String _
) As TcpClient
[C#]
public TcpClient Connect(
string serverAddress,
int serverPort,
string userName
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user name.

Return Value

The TcpClient to use to communicate with the destination server.

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace | Socks4Client.Connect Overload List


Socks4Client.Connect Method (String, Int32, String, String)

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overrides Overloads Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String _
) As TcpClient _
Implements IProxyClient.Connect
[C#]
public override TcpClient Connect(
string serverAddress,
int serverPort,
string userName,
string password
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user name.
password
The password is ignored and should be null.

Return Value

The TcpClient to use to communicate with the destination server.

Implements

IProxyClient.Connect

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

Socks4Client Class | ComponentSpace.Proxy.Socks4 Namespace | Socks4Client.Connect Overload List


Socks4Command Class

A SOCKS 4/4A command.

For a list of all members of this type, see Socks4Command Members.

System.Object
ComponentSpace.Proxy.Socks4.Socks4Command
ComponentSpace.Proxy.Socks4.Socks4ConnectCommand

[Visual Basic]
MustInherit Public Class Socks4Command
[C#]
public abstract class Socks4Command

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

For specific message details refer to the SOCKS 4/4A RFC's.

Requirements

Namespace: ComponentSpace.Proxy.Socks4

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks4Command Members | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command Members

Socks4Command overview

Public Instance Properties

CommandCode | Gets the command code.
DestinationAddress | Gets or sets the destination server IP address.
DestinationPort | Gets or sets the destination server port number.
IsSocks4A | Gets or sets the flag indicating whether SOCKS 4A. If true the command format is SOCKS 4A compliant. If false the command format is SOCKS 4 compliant.
UserName | Gets or sets the user name.
VersionNumber | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray | Converts the command to an array of bytes in SOCKS 4 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command Properties

The properties of the Socks4Command class are listed below. For a complete list of Socks4Command class members, see the Socks4Command Members topic.

Public Instance Properties

CommandCode | Gets the command code.
DestinationAddress | Gets or sets the destination server IP address.
DestinationPort | Gets or sets the destination server port number.
IsSocks4A | Gets or sets the flag indicating whether SOCKS 4A. If true the command format is SOCKS 4A compliant. If false the command format is SOCKS 4 compliant.
UserName | Gets or sets the user name.
VersionNumber | Gets the version number.

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command.CommandCode Property

Gets the command code.

[Visual Basic]
Public ReadOnly Property CommandCode As CommandCode
[C#]
public CommandCode CommandCode {get;}

Property Value

The command code.

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command.DestinationAddress Property

Gets or sets the destination server IP address.

[Visual Basic]
Public Property DestinationAddress As String
[C#]
public string DestinationAddress {get; set;}

Property Value

The destination server IP address.

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command.DestinationPort Property

Gets or sets the destination server port number.

[Visual Basic]
Public Property DestinationPort As Integer
[C#]
public int DestinationPort {get; set;}

Property Value

The destination server port number.

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command.IsSocks4A Property

Gets or sets the flag indicating whether SOCKS 4A. If true the command format is SOCKS 4A compliant. If false the command format is SOCKS 4 compliant.

[Visual Basic]
Public Property IsSocks4A As Boolean
[C#]
public bool IsSocks4A {get; set;}

Property Value

The flag indicating whether SOCKS 4A (defaults to false).

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command.UserName Property

Gets or sets the user name.

[Visual Basic]
Public Property UserName As String
[C#]
public string UserName {get; set;}

Property Value

The user name.

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command.VersionNumber Property

Gets the version number.

[Visual Basic]
Public ReadOnly Property VersionNumber As Byte
[C#]
public byte VersionNumber {get;}

Property Value

The version number (defaults to 4).

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command Methods

The methods of the Socks4Command class are listed below. For a complete list of Socks4Command class members, see the Socks4Command Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray | Converts the command to an array of bytes in SOCKS 4 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4Command.ToByteArray Method

Converts the command to an array of bytes in SOCKS 4 format.

[Visual Basic]
Public Function ToByteArray() As Byte()
[C#]
public byte[] ToByteArray();

Return Value

The command as an arrary of bytes in SOCKS 4 format.

Exceptions

Exception Type | Condition
ProxyException | Thrown when the command cannot be converted to a byte array.

See Also

Socks4Command Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4CommandReply Class

A SOCKS 4/4A command reply.

For a list of all members of this type, see Socks4CommandReply Members.

System.Object
ComponentSpace.Proxy.Socks4.Socks4CommandReply

[Visual Basic]
Public Class Socks4CommandReply
[C#]
public class Socks4CommandReply

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

For specific message details refer to the SOCKS 4/4A RFC's.

Requirements

Namespace: ComponentSpace.Proxy.Socks4

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks4CommandReply Members | ComponentSpace.Proxy.Socks4 Namespace


Socks4CommandReply Members

Socks4CommandReply overview

Public Instance Constructors

Socks4CommandReply Constructor Constructs from a byte array.

Public Instance Properties

DestinationAddress | Gets the destination server IP address.
DestinationPort | Gets the destination server port number.
ReplyCode | Gets the reply code.
VersionNumber | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks4CommandReply Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4CommandReply Constructor

Constructs from a byte array.

[Visual Basic]
Public Sub New( _
ByVal bytes As Byte(), _
ByVal index As Integer, _
ByVal count As Integer _
)
[C#]
public Socks4CommandReply(
byte[] bytes,
int index,
int count
);

Parameters

bytes
The byte array containing the message.
index
The index into the byte array.
count
The number of bytes available in the byte array.

See Also

Socks4CommandReply Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4CommandReply Properties

The properties of the Socks4CommandReply class are listed below. For a complete list of Socks4CommandReply class members, see the Socks4CommandReply Members topic.

Public Instance Properties

DestinationAddress | Gets the destination server IP address.
DestinationPort | Gets the destination server port number.
ReplyCode | Gets the reply code.
VersionNumber | Gets the version number.

See Also

Socks4CommandReply Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4CommandReply.DestinationAddress Property

Gets the destination server IP address.

[Visual Basic]
Public ReadOnly Property DestinationAddress As String
[C#]
public string DestinationAddress {get;}

Property Value

The destination server IP address.

See Also

Socks4CommandReply Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4CommandReply.DestinationPort Property

Gets the destination server port number.

[Visual Basic]
Public ReadOnly Property DestinationPort As Integer
[C#]
public int DestinationPort {get;}

Property Value

The destination server port number.

See Also

Socks4CommandReply Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4CommandReply.ReplyCode Property

Gets the reply code.

[Visual Basic]
Public ReadOnly Property ReplyCode As ReplyCode
[C#]
public ReplyCode ReplyCode {get;}

Property Value

The reply code.

See Also

Socks4CommandReply Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4CommandReply.VersionNumber Property

Gets the version number.

[Visual Basic]
Public ReadOnly Property VersionNumber As Byte
[C#]
public byte VersionNumber {get;}

Property Value

The version number.

See Also

Socks4CommandReply Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4ConnectCommand Class

A SOCKS 4/4A Connect command.

For a list of all members of this type, see Socks4ConnectCommand Members.

System.Object
ComponentSpace.Proxy.Socks4.Socks4Command
ComponentSpace.Proxy.Socks4.Socks4ConnectCommand

[Visual Basic]
Public Class Socks4ConnectCommand
Inherits Socks4Command
[C#]
public class Socks4ConnectCommand : Socks4Command

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

For specific message details refer to the SOCKS 4 / SOCKS 4A RFC's.

Requirements

Namespace: ComponentSpace.Proxy.Socks4

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks4ConnectCommand Members | ComponentSpace.Proxy.Socks4 Namespace


Socks4ConnectCommand Members

Socks4ConnectCommand overview

Public Instance Constructors

Socks4ConnectCommand Constructor The default constructor.

Public Instance Properties

CommandCode (inherited from Socks4Command) | Gets the command code.
DestinationAddress (inherited from Socks4Command) | Gets or sets the destination server IP address.
DestinationPort (inherited from Socks4Command) | Gets or sets the destination server port number.
IsSocks4A (inherited from Socks4Command) | Gets or sets the flag indicating whether SOCKS 4A. If true the command format is SOCKS 4A compliant. If false the command format is SOCKS 4 compliant.
UserName (inherited from Socks4Command) | Gets or sets the user name.
VersionNumber (inherited from Socks4Command) | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray (inherited from Socks4Command) | Converts the command to an array of bytes in SOCKS 4 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks4ConnectCommand Class | ComponentSpace.Proxy.Socks4 Namespace


Socks4ConnectCommand Constructor

The default constructor.

[Visual Basic]
Public Sub New()
[C#]
public Socks4ConnectCommand();

See Also

Socks4ConnectCommand Class | ComponentSpace.Proxy.Socks4 Namespace


ComponentSpace.Proxy.Socks5

ComponentSpace Proxy Class Library Reference

ComponentSpace.Proxy.Socks5 Namespace

The ComponentSpace.Proxy.Socks4 namespace contains classes that implement the SOCKS v5 protocol.

Namespace hierarchy

Classes

Class | Description
Socks5Client | The Socks5Client permits connections to be made through a SOCKS 5 proxy server.
Socks5Command | A SOCKS 5 command.
Socks5CommandReply | A SOCKS 5 command reply.
Socks5ConnectCommand | A SOCKS 5 Connect command.
Socks5MethodCommand | A SOCKS 5 method command.
Socks5MethodReply | A SOCKS 5 method reply.
Socks5UsernamePasswordCommand | A SOCKS 5 username/password command.
Socks5UsernamePasswordReply | A SOCKS 5 username/password reply.

Enumerations

Enumeration | Description
AddressType | The SOCKS 5 address type.
AuthenticationStatus | The SOCKS 5 authentication status.
CommandCode | The SOCKS 5 command code.
MethodType | The SOCKS 5 method types.
ReplyCode | The SOCKS 5 reply codes.


AddressType Enumeration

The SOCKS 5 address type.

[Visual Basic]
Public Enum AddressType
[C#]
public enum AddressType

Members

Member Name | Description
IPv4 | IP v4
DomainName | Domain name
IPv6 | IP v6

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy.Socks5 Namespace


AuthenticationStatus Enumeration

The SOCKS 5 authentication status.

[Visual Basic]
Public Enum AuthenticationStatus
[C#]
public enum AuthenticationStatus

Members

Member Name | Description
Successful | Successful
Failed | Failed

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy.Socks5 Namespace


CommandCode Enumeration

The SOCKS 5 command code.

[Visual Basic]
Public Enum CommandCode
[C#]
public enum CommandCode

Members

Member Name | Description
Connect | Connect

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy.Socks5 Namespace


MethodType Enumeration

The SOCKS 5 method types.

[Visual Basic]
Public Enum MethodType
[C#]
public enum MethodType

Members

Member Name | Description
NoAuthenticationRequired | No authentication required.
GSSAPI | GSSAPI
UsernamePassword | User name/password
NoAcceptableMethods | No acceptable methods

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy.Socks5 Namespace


ReplyCode Enumeration

The SOCKS 5 reply codes.

[Visual Basic]
Public Enum ReplyCode
[C#]
public enum ReplyCode

Members

Member Name | Description
Succeeded | Succeeded
ServerFailure | General SOCKS server failure
ConnectionNotAllowed | Connection not allowed by ruleset
NetworkUnreachable | Network unreacable
HostUnreachable | Host unreachable
ConnectionRefused | Connection refused
TTLExpired | TTL expired
CommandNotSupported | Command not supported
AddressTypeNotSupported | Address type not supported

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

ComponentSpace.Proxy.Socks5 Namespace


Socks5Client Class

The Socks5Client permits connections to be made through a SOCKS 5 proxy server.

For a list of all members of this type, see Socks5Client Members.

System.Object
ComponentSpace.Proxy.ProxyClientBase
ComponentSpace.Proxy.Socks5.Socks5Client

[Visual Basic]
Public Class Socks5Client
Inherits ProxyClientBase
[C#]
public class Socks5Client : ProxyClientBase

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks5Client Members | ComponentSpace.Proxy.Socks5 Namespace


Socks5Client Members

Socks5Client overview

Public Instance Constructors

Socks5Client Overloaded. Initializes a new instance of the Socks5Client class.

Public Instance Properties

ReceiveTimeout (inherited from ProxyClientBase) | Gets or sets the number of milliseconds to wait for the response from the proxy server.
SendTimeout (inherited from ProxyClientBase) | Gets or sets the number of milliseconds to wait for the request to be sent to the proxy server.
SynchronizingObject (inherited from ProxyClientBase) | Gets or sets the synchonizing object for receiving events.

Public Instance Methods

BeginConnect (inherited from ProxyClientBase) | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Overloaded. Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect (inherited from ProxyClientBase) | Completes the specified asynchronous connect operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ConnectCompleted (inherited from ProxyClientBase) Occurs when the connect has completed.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Client Constructor

Initializes a new instance of the Socks5Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

Overload List

Initializes a new instance of the Socks5Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

public Socks5Client(string);

Initializes a new instance of the Socks5Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

public Socks5Client(string,int);

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Client Constructor (String)

Initializes a new instance of the Socks5Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

[Visual Basic]
Overloads Public Sub New( _
ByVal proxyAddress As String _
)
[C#]
public Socks5Client(
string proxyAddress
);

Parameters

proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).

Remarks

The proxy server port defaults to 1080.

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace | Socks5Client Constructor Overload List


Socks5Client Constructor (String, Int32)

Initializes a new instance of the Socks5Client class with the specified proxy server address and port. The address can either be the name of the server (eg. www.myproxy.com) or its IP address (eg. 66.210.153.10).

[Visual Basic]
Overloads Public Sub New( _
ByVal proxyAddress As String, _
ByVal proxyPort As Integer _
)
[C#]
public Socks5Client(
string proxyAddress,
int proxyPort
);

Parameters

proxyAddress
The proxy server address (eg. 66.210.153.10 or www.myproxy.com).
proxyPort
The proxy server port number.

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace | Socks5Client Constructor Overload List


Socks5Client Methods

The methods of the Socks5Client class are listed below. For a complete list of Socks5Client class members, see the Socks5Client Members topic.

Public Instance Methods

BeginConnect (inherited from ProxyClientBase) | Overloaded. Initiates an asynchronous connect operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.
Connect | Overloaded. Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.
EndConnect (inherited from ProxyClientBase) | Completes the specified asynchronous connect operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace


Connect Method

ComponentSpace Proxy Class Library Reference

Socks5Client.Connect Method

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

Overload List

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

public TcpClient Connect(string,int);

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

public TcpClient Connect(string,int,string);

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

public override TcpClient Connect(string,int,string,string);

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Client.Connect Method (String, Int32)

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overloads Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer _
) As TcpClient
[C#]
public TcpClient Connect(
string serverAddress,
int serverPort
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.

Return Value

The TcpClient to use to communicate with the destination server.

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace | Socks5Client.Connect Overload List


Socks5Client.Connect Method (String, Int32, String)

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overloads Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String _
) As TcpClient
[C#]
public TcpClient Connect(
string serverAddress,
int serverPort,
string userName
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user name.

Return Value

The TcpClient to use to communicate with the destination server.

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace | Socks5Client.Connect Overload List


Socks5Client.Connect Method (String, Int32, String, String)

Connects to the proxy server and, if successful, a TcpClient is returned for communications with the destination server.

[Visual Basic]
Overrides Overloads Public Function Connect( _
ByVal serverAddress As String, _
ByVal serverPort As Integer, _
ByVal userName As String, _
ByVal password As String _
) As TcpClient _
Implements IProxyClient.Connect
[C#]
public override TcpClient Connect(
string serverAddress,
int serverPort,
string userName,
string password
);

Parameters

serverAddress
The destination server address (eg. 66.210.153.11 or www.myserver.com).
serverPort
The destination server port number.
userName
The user name.
password
The password.

Return Value

The TcpClient to use to communicate with the destination server.

Implements

IProxyClient.Connect

Exceptions

Exception Type | Condition
ProxyException | Thrown if the connect fails.

See Also

Socks5Client Class | ComponentSpace.Proxy.Socks5 Namespace | Socks5Client.Connect Overload List


Socks5Command Class

A SOCKS 5 command.

For a list of all members of this type, see Socks5Command Members.

System.Object
ComponentSpace.Proxy.Socks5.Socks5Command
ComponentSpace.Proxy.Socks5.Socks5ConnectCommand

[Visual Basic]
MustInherit Public Class Socks5Command
[C#]
public abstract class Socks5Command

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

For specific message details refer to the SOCKS 5 RFC's.

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks5Command Members | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command Members

Socks5Command overview

Public Instance Properties

AddressType | Gets or sets the address type.
CommandCode | Gets the command code.
DestinationAddress | Gets or sets the destination server IP address.
DestinationPort | Gets or sets the destination server port number.
VersionNumber | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray | Converts the command to an array of bytes in SOCKS 5 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command Properties

The properties of the Socks5Command class are listed below. For a complete list of Socks5Command class members, see the Socks5Command Members topic.

Public Instance Properties

AddressType | Gets or sets the address type.
CommandCode | Gets the command code.
DestinationAddress | Gets or sets the destination server IP address.
DestinationPort | Gets or sets the destination server port number.
VersionNumber | Gets the version number.

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command.AddressType Property

Gets or sets the address type.

[Visual Basic]
Public Property AddressType As AddressType
[C#]
public AddressType AddressType {get; set;}

Property Value

The address type (defaults to IP v4).

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command.CommandCode Property

Gets the command code.

[Visual Basic]
Public ReadOnly Property CommandCode As CommandCode
[C#]
public CommandCode CommandCode {get;}

Property Value

The command code.

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command.DestinationAddress Property

Gets or sets the destination server IP address.

[Visual Basic]
Public Property DestinationAddress As String
[C#]
public string DestinationAddress {get; set;}

Property Value

The destination server IP address.

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command.DestinationPort Property

Gets or sets the destination server port number.

[Visual Basic]
Public Property DestinationPort As Integer
[C#]
public int DestinationPort {get; set;}

Property Value

The destination server port number.

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command.VersionNumber Property

Gets the version number.

[Visual Basic]
Public ReadOnly Property VersionNumber As Byte
[C#]
public byte VersionNumber {get;}

Property Value

The version number (defaults to 5).

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command Methods

The methods of the Socks5Command class are listed below. For a complete list of Socks5Command class members, see the Socks5Command Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray | Converts the command to an array of bytes in SOCKS 5 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5Command.ToByteArray Method

Converts the command to an array of bytes in SOCKS 5 format.

[Visual Basic]
Public Function ToByteArray() As Byte()
[C#]
public byte[] ToByteArray();

Return Value

The command as an array of bytes in SOCKS 5 format.

Exceptions

Exception Type | Condition
ProxyException | Thrown when the command cannot be converted to a byte array.

See Also

Socks5Command Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply Class

A SOCKS 5 command reply.

For a list of all members of this type, see Socks5CommandReply Members.

System.Object
ComponentSpace.Proxy.Socks5.Socks5CommandReply

[Visual Basic]
Public Class Socks5CommandReply
[C#]
public class Socks5CommandReply

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

For specific message details refer to the SOCKS 5 RFC's.

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks5CommandReply Members | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply Members

Socks5CommandReply overview

Public Instance Constructors

Socks5CommandReply Constructor Constructs from a byte array.

Public Instance Properties

AddressType | Gets the address type.
ReplyCode | Gets the reply code.
ServerBoundAddress | Gets the server bound address.
ServerBoundPort | Gets the server bound port number.
VersionNumber | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5CommandReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply Constructor

Constructs from a byte array.

[Visual Basic]
Public Sub New( _
ByVal bytes As Byte(), _
ByVal index As Integer, _
ByVal count As Integer _
)
[C#]
public Socks5CommandReply(
byte[] bytes,
int index,
int count
);

Parameters

bytes
The byte array containing the message.
index
The index into the byte array.
count
The number of bytes available in the byte array.

See Also

Socks5CommandReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply Properties

The properties of the Socks5CommandReply class are listed below. For a complete list of Socks5CommandReply class members, see the Socks5CommandReply Members topic.

Public Instance Properties

AddressType | Gets the address type.
ReplyCode | Gets the reply code.
ServerBoundAddress | Gets the server bound address.
ServerBoundPort | Gets the server bound port number.
VersionNumber | Gets the version number.

See Also

Socks5CommandReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply.AddressType Property

Gets the address type.

[Visual Basic]
Public ReadOnly Property AddressType As AddressType
[C#]
public AddressType AddressType {get;}

Property Value

The reply code.

See Also

Socks5CommandReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply.ReplyCode Property

Gets the reply code.

[Visual Basic]
Public ReadOnly Property ReplyCode As ReplyCode
[C#]
public ReplyCode ReplyCode {get;}

Property Value

The reply code.

See Also

Socks5CommandReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply.ServerBoundAddress Property

Gets the server bound address.

[Visual Basic]
Public ReadOnly Property ServerBoundAddress As String
[C#]
public string ServerBoundAddress {get;}

Property Value

The server bound address.

See Also

Socks5CommandReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply.ServerBoundPort Property

Gets the server bound port number.

[Visual Basic]
Public ReadOnly Property ServerBoundPort As Integer
[C#]
public int ServerBoundPort {get;}

Property Value

The server bound port number.

See Also

Socks5CommandReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5CommandReply.VersionNumber Property

Gets the version number.

[Visual Basic]
Public ReadOnly Property VersionNumber As Byte
[C#]
public byte VersionNumber {get;}

Property Value

The version number.

See Also

Socks5CommandReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5ConnectCommand Class

A SOCKS 5 Connect command.

For a list of all members of this type, see Socks5ConnectCommand Members.

System.Object
ComponentSpace.Proxy.Socks5.Socks5Command
ComponentSpace.Proxy.Socks5.Socks5ConnectCommand

[Visual Basic]
Public Class Socks5ConnectCommand
Inherits Socks5Command
[C#]
public class Socks5ConnectCommand : Socks5Command

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

For specific message details refer to the SOCKS 5 RFC's.

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks5ConnectCommand Members | ComponentSpace.Proxy.Socks5 Namespace


Socks5ConnectCommand Members

Socks5ConnectCommand overview

Public Instance Constructors

Socks5ConnectCommand Constructor The default constructor.

Public Instance Properties

AddressType (inherited from Socks5Command) | Gets or sets the address type.
CommandCode (inherited from Socks5Command) | Gets the command code.
DestinationAddress (inherited from Socks5Command) | Gets or sets the destination server IP address.
DestinationPort (inherited from Socks5Command) | Gets or sets the destination server port number.
VersionNumber (inherited from Socks5Command) | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray (inherited from Socks5Command) | Converts the command to an array of bytes in SOCKS 5 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5ConnectCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5ConnectCommand Constructor

The default constructor.

[Visual Basic]
Public Sub New()
[C#]
public Socks5ConnectCommand();

See Also

Socks5ConnectCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand Class

A SOCKS 5 method command.

For a list of all members of this type, see Socks5MethodCommand Members.

System.Object
ComponentSpace.Proxy.Socks5.Socks5MethodCommand

[Visual Basic]
Public Class Socks5MethodCommand
[C#]
public class Socks5MethodCommand

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks5MethodCommand Members | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand Members

Socks5MethodCommand overview

Public Instance Constructors

Socks5MethodCommand Constructor Creates a Socks5MethodCommand.

Public Instance Properties

MethodTypes | Gets the method types.
VersionNumber | Gets the version number.

Public Instance Methods

AddMethod | Add a method.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray | Converts the command to an array of bytes in SOCKS 5 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5MethodCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand Constructor

Creates a Socks5MethodCommand.

[Visual Basic]
Public Sub New()
[C#]
public Socks5MethodCommand();

See Also

Socks5MethodCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand Properties

The properties of the Socks5MethodCommand class are listed below. For a complete list of Socks5MethodCommand class members, see the Socks5MethodCommand Members topic.

Public Instance Properties

MethodTypes | Gets the method types.
VersionNumber | Gets the version number.

See Also

Socks5MethodCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand.MethodTypes Property

Gets the method types.

[Visual Basic]
Public ReadOnly Property MethodTypes As IList
[C#]
public System.Collections.IList MethodTypes {get;}

Property Value

The method types.

See Also

Socks5MethodCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand.VersionNumber Property

Gets the version number.

[Visual Basic]
Public ReadOnly Property VersionNumber As Byte
[C#]
public byte VersionNumber {get;}

Property Value

The version number (defaults to 5).

See Also

Socks5MethodCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand Methods

The methods of the Socks5MethodCommand class are listed below. For a complete list of Socks5MethodCommand class members, see the Socks5MethodCommand Members topic.

Public Instance Methods

AddMethod | Add a method.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray | Converts the command to an array of bytes in SOCKS 5 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5MethodCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand.AddMethod Method

Add a method.

[Visual Basic]
Public Sub AddMethod( _
ByVal methodType As MethodType _
)
[C#]
public void AddMethod(
MethodType methodType
);

Parameters

methodType
the method

See Also

Socks5MethodCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodCommand.ToByteArray Method

Converts the command to an array of bytes in SOCKS 5 format.

[Visual Basic]
Public Function ToByteArray() As Byte()
[C#]
public byte[] ToByteArray();

Return Value

The command as an array of bytes in SOCKS 5 format.

Exceptions

Exception Type | Condition
ProxyException | Thrown when the command cannot be converted to a byte array.

See Also

Socks5MethodCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodReply Class

A SOCKS 5 method reply.

For a list of all members of this type, see Socks5MethodReply Members.

System.Object
ComponentSpace.Proxy.Socks5.Socks5MethodReply

[Visual Basic]
Public Class Socks5MethodReply
[C#]
public class Socks5MethodReply

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks5MethodReply Members | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodReply Members

Socks5MethodReply overview

Public Instance Constructors

Socks5MethodReply Constructor Constructs from a byte array.

Public Instance Properties

MethodType | Gets the method type.
VersionNumber | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5MethodReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodReply Constructor

Constructs from a byte array.

[Visual Basic]
Public Sub New( _
ByVal bytes As Byte(), _
ByVal index As Integer, _
ByVal count As Integer _
)
[C#]
public Socks5MethodReply(
byte[] bytes,
int index,
int count
);

Parameters

bytes
The byte array containing the message.
index
The index into the byte array.
count
The number of bytes available in the byte array.

See Also

Socks5MethodReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodReply Properties

The properties of the Socks5MethodReply class are listed below. For a complete list of Socks5MethodReply class members, see the Socks5MethodReply Members topic.

Public Instance Properties

MethodType | Gets the method type.
VersionNumber | Gets the version number.

See Also

Socks5MethodReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodReply.MethodType Property

Gets the method type.

[Visual Basic]
Public ReadOnly Property MethodType As MethodType
[C#]
public MethodType MethodType {get;}

Property Value

The method type.

See Also

Socks5MethodReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5MethodReply.VersionNumber Property

Gets the version number.

[Visual Basic]
Public ReadOnly Property VersionNumber As Byte
[C#]
public byte VersionNumber {get;}

Property Value

The version number.

See Also

Socks5MethodReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand Class

A SOCKS 5 username/password command.

For a list of all members of this type, see Socks5UsernamePasswordCommand Members.

System.Object
ComponentSpace.Proxy.Socks5.Socks5UsernamePasswordCommand

[Visual Basic]
Public Class Socks5UsernamePasswordCommand
[C#]
public class Socks5UsernamePasswordCommand

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks5UsernamePasswordCommand Members | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand Members

Socks5UsernamePasswordCommand overview

Public Instance Constructors

Socks5UsernamePasswordCommand Constructor Constructs a Socks5UsernamePasswordCommand.

Public Instance Properties

Password | Gets the password.
UserName | Gets the user name.
VersionNumber | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray | Converts the command to an array of bytes in SOCKS 5 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5UsernamePasswordCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand Constructor

Constructs a Socks5UsernamePasswordCommand.

[Visual Basic]
Public Sub New( _
ByVal userName As String, _
ByVal password As String _
)
[C#]
public Socks5UsernamePasswordCommand(
string userName,
string password
);

Parameters

userName
The user name.
password
The password

See Also

Socks5UsernamePasswordCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand Properties

The properties of the Socks5UsernamePasswordCommand class are listed below. For a complete list of Socks5UsernamePasswordCommand class members, see the Socks5UsernamePasswordCommand Members topic.

Public Instance Properties

Password | Gets the password.
UserName | Gets the user name.
VersionNumber | Gets the version number.

See Also

Socks5UsernamePasswordCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand.Password Property

Gets the password.

[Visual Basic]
Public ReadOnly Property Password As String
[C#]
public string Password {get;}

Property Value

The password.

See Also

Socks5UsernamePasswordCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand.UserName Property

Gets the user name.

[Visual Basic]
Public ReadOnly Property UserName As String
[C#]
public string UserName {get;}

Property Value

The user name.

See Also

Socks5UsernamePasswordCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand.VersionNumber Property

Gets the version number.

[Visual Basic]
Public ReadOnly Property VersionNumber As Byte
[C#]
public byte VersionNumber {get;}

Property Value

The version number (defaults to 1).

See Also

Socks5UsernamePasswordCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand Methods

The methods of the Socks5UsernamePasswordCommand class are listed below. For a complete list of Socks5UsernamePasswordCommand class members, see the Socks5UsernamePasswordCommand Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToByteArray | Converts the command to an array of bytes in SOCKS 5 format.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5UsernamePasswordCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordCommand.ToByteArray Method

Converts the command to an array of bytes in SOCKS 5 format.

[Visual Basic]
Public Function ToByteArray() As Byte()
[C#]
public byte[] ToByteArray();

Return Value

The command as an array of bytes in SOCKS 5 format.

Exceptions

Exception Type | Condition
ProxyException | Thrown when the command cannot be converted to a byte array.

See Also

Socks5UsernamePasswordCommand Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordReply Class

A SOCKS 5 username/password reply.

For a list of all members of this type, see Socks5UsernamePasswordReply Members.

System.Object
ComponentSpace.Proxy.Socks5.Socks5UsernamePasswordReply

[Visual Basic]
Public Class Socks5UsernamePasswordReply
[C#]
public class Socks5UsernamePasswordReply

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.Proxy.Socks5

Assembly: ComponentSpace.Proxy (in ComponentSpace.Proxy.dll)

See Also

Socks5UsernamePasswordReply Members | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordReply Members

Socks5UsernamePasswordReply overview

Public Instance Constructors

Socks5UsernamePasswordReply Constructor Constructs from a byte array.

Public Instance Properties

AuthenticationStatus | Gets the authentication status.
VersionNumber | Gets the version number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Socks5UsernamePasswordReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordReply Constructor

Constructs from a byte array.

[Visual Basic]
Public Sub New( _
ByVal bytes As Byte(), _
ByVal index As Integer, _
ByVal count As Integer _
)
[C#]
public Socks5UsernamePasswordReply(
byte[] bytes,
int index,
int count
);

Parameters

bytes
The byte array containing the message.
index
The index into the byte array.
count
The number of bytes available in the byte array.

See Also

Socks5UsernamePasswordReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordReply Properties

The properties of the Socks5UsernamePasswordReply class are listed below. For a complete list of Socks5UsernamePasswordReply class members, see the Socks5UsernamePasswordReply Members topic.

Public Instance Properties

AuthenticationStatus | Gets the authentication status.
VersionNumber | Gets the version number.

See Also

Socks5UsernamePasswordReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordReply.AuthenticationStatus Property

Gets the authentication status.

[Visual Basic]
Public ReadOnly Property AuthenticationStatus As AuthenticationStatus
[C#]
public AuthenticationStatus AuthenticationStatus {get;}

Property Value

The authentication status.

See Also

Socks5UsernamePasswordReply Class | ComponentSpace.Proxy.Socks5 Namespace


Socks5UsernamePasswordReply.VersionNumber Property

Gets the version number.

[Visual Basic]
Public ReadOnly Property VersionNumber As Byte
[C#]
public byte VersionNumber {get;}

Property Value

The version number.

See Also

Socks5UsernamePasswordReply Class | ComponentSpace.Proxy.Socks5 Namespace


ComponentSpace.Proxy.HttpHierarchy

ComponentSpace Proxy Class Library Reference

ComponentSpace.Proxy.Http Hierarchy

System.Object
ComponentSpace.Proxy.ProxyClientBase ---- ComponentSpace.Proxy.IProxyClient
ComponentSpace.Proxy.Http.HttpProxyClient

See Also

ComponentSpace.Proxy.Http Namespace


ComponentSpace.Proxy.Socks4Hierarchy

ComponentSpace Proxy Class Library Reference

ComponentSpace.Proxy.Socks4 Hierarchy

System.Object
ComponentSpace.Proxy.ProxyClientBase ---- ComponentSpace.Proxy.IProxyClient
ComponentSpace.Proxy.Socks4.Socks4Client
ComponentSpace.Proxy.Socks4.Socks4Command
ComponentSpace.Proxy.Socks4.Socks4ConnectCommand
ComponentSpace.Proxy.Socks4.Socks4CommandReply
System.ValueType
System.Enum ---- System.IComparable, System.IConvertible, System.IFormattable
ComponentSpace.Proxy.Socks4.CommandCode
ComponentSpace.Proxy.Socks4.ReplyCode

See Also

ComponentSpace.Proxy.Socks4 Namespace


ComponentSpace.Proxy.Socks5Hierarchy

ComponentSpace Proxy Class Library Reference

ComponentSpace.Proxy.Socks5 Hierarchy

System.Object
ComponentSpace.Proxy.ProxyClientBase ---- ComponentSpace.Proxy.IProxyClient
ComponentSpace.Proxy.Socks5.Socks5Client
ComponentSpace.Proxy.Socks5.Socks5Command
ComponentSpace.Proxy.Socks5.Socks5ConnectCommand
ComponentSpace.Proxy.Socks5.Socks5CommandReply
ComponentSpace.Proxy.Socks5.Socks5MethodCommand
ComponentSpace.Proxy.Socks5.Socks5MethodReply
ComponentSpace.Proxy.Socks5.Socks5UsernamePasswordCommand
ComponentSpace.Proxy.Socks5.Socks5UsernamePasswordReply
System.ValueType
System.Enum ---- System.IComparable, System.IConvertible, System.IFormattable
ComponentSpace.Proxy.Socks5.AddressType
ComponentSpace.Proxy.Socks5.AuthenticationStatus
ComponentSpace.Proxy.Socks5.CommandCode
ComponentSpace.Proxy.Socks5.MethodType
ComponentSpace.Proxy.Socks5.ReplyCode

See Also

ComponentSpace.Proxy.Socks5 Namespace


ComponentSpace.ProxyHierarchy

ComponentSpace Proxy Class Library Reference

ComponentSpace.Proxy Hierarchy

System.Object
ComponentSpace.Proxy.IProxyClient
ComponentSpace.Proxy.ProxyClientBase ---- ComponentSpace.Proxy.IProxyClient
ComponentSpace.Proxy.ProxyClientFactory
ComponentSpace.Proxy.ProxySettings
System.Delegate ---- System.ICloneable, System.Runtime.Serialization.ISerializable
System.MulticastDelegate
ComponentSpace.Proxy.ConnectCompletedEventHandler
System.EventArgs
ComponentSpace.Proxy.ConnectCompletedEventArgs
System.Exception ---- System.Runtime.Serialization.ISerializable
System.ApplicationException
ComponentSpace.Proxy.ProxyException
System.ValueType
System.Enum ---- System.IComparable, System.IConvertible, System.IFormattable
ComponentSpace.Proxy.ProxyType

See Also

ComponentSpace.Proxy Namespace