Skip to content
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Latest commit

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ProxySocket

ProxySocket is an implementation of the SOCKS4/SOCKS5/HTTPS CONNECT protocol in C# originally developed by mentalis.org

It supports username/password authentication and asynchronous calls

It inherits from a standard Socket class

Example usage:

// create a new ProxySocketProxySockets=newProxySocket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);// set the proxy settingss.ProxyEndPoint=newIPEndPoint(IPAddress.Parse("10.0.0.5"),1080);s.ProxyUser="username";s.ProxyPass="password";s.ProxyType=ProxyTypes.Socks5;// if you set this to ProxyTypes.None, // the ProxySocket will act as a normal Socket// connect to the remote server// (note that the proxy server will resolve the domain name for us)s.Connect("www.mentalis.org",80);// send an HTTP requests.Send(Encoding.ASCII.GetBytes("GET / HTTP/1.0\r\nHost: www.mentalis.org\r\n\r\n"));// read the HTTP replyintrecv=0;byte[]buffer=newbyte[1024];recv=s.Receive(buffer);while(recv>0){Console.Write(Encoding.ASCII.GetString(buffer,0,recv));recv=s.Receive(buffer);}// wait until the user presses enterConsole.WriteLine("Press enter to continue...");Console.ReadLine();

About

A maintained version of ProxySocket class by Mentalis.org

Resources

Stars

70 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages