ComponentSpace Professional .NET and ActiveX components for developers
ComponentSpace Home | Products | Downloads | Support | Purchase | Services | About Us
 

Code Samples

The product includes numerous VB.NET and C# sample applications. All samples include complete source code. For more detailed sample code please refer to the sample applications.


Connecting via a Proxy Server

Listing 1 demonstrates connecting via a proxy server.



Dim proxyClient As IProxyClient = _
    ProxyClientFactory.CreateProxyClient(ProxyType.Socks5, "myproxyserver", 1080)

Dim tcpClient as TcpClient = _
    proxyClient.Connect("mytargetserver", 80, "myuser", "mypassword")

' The TcpClient is now ready for sending/receiving data to/from the target server 
' via the proxy server.
									

Listing 1 Connecting via a proxy server