Giter Club home page Giter Club logo

proxysocket's Introduction

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 ProxySocket
ProxySocket s = new ProxySocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
// set the proxy settings
s.ProxyEndPoint = new IPEndPoint(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 request
s.Send(Encoding.ASCII.GetBytes("GET / HTTP/1.0\r\nHost: www.mentalis.org\r\n\r\n"));
// read the HTTP reply
int recv = 0;
byte [] buffer = new byte[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 enter
Console.WriteLine("Press enter to continue...");
Console.ReadLine();

proxysocket's People

Contributors

poma avatar sh2ezo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxysocket's Issues

Socks5 Connection Without Username/Pass?

Hello, It appears that there is no way for me to connect to a Socks5 proxy server that does not use a use username/password.

The Socks5 proxy server I am trying to connect to does not need a password to connect. So how do I connect to Socks5 server without a username and password using your ProxySocket class? Whenever I try to connect without setting "ProxyUser" and "ProxyPass" it says "Username/password combination not accepted."

Any help would be appreciated, thanks for your time.

.NET Core Project Target Framework

warning NU1701: Package 'ProxySocket 1.1.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

It'd be good if there was a target project for .NET core specifically to avoid these warnings.

.NET Core nuget package

Hello,

please add support for .NET Core, currently trying to add this package to a project fails like this:

Restoring packages for ...
Package ProxySocket 1.1.2 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package ProxySocket 1.1.2 supports: net40 (.NETFramework,Version=v4.0)
One or more packages are incompatible with .NETCoreApp,Version=v1.1.
Package restore failed. Rolling back package changes for '...'.

Help with some errors plz

Hello. I built my project and injected my ip address, port 443 and username password.
then set connection type to socks5 and recieved this error on my server:

Unhandled Exception: System.Net.Sockets.SocketException: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) <0x40ade010 + 0x0019f> in <filename unknown>:0 at Org.Mentalis.Network.ProxySocket.ProxySocket.Connect (System.String host, Int32 port) <0x40addd60 + 0x000d3> in <filename unknown>:0 at socks5_vpn.Program.Main (System.String[] args) <0x40ab0d50 + 0x001a3> in <filename unknown>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.Net.Sockets.SocketException: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) <0x40ade010 + 0x0019f> in <filename unknown>:0 at Org.Mentalis.Network.ProxySocket.ProxySocket.Connect (System.String host, Int32 port) <0x40addd60 + 0x000d3> in <filename unknown>:0 at socks5_vpn.Program.Main (System.String[] args) <0x40ab0d50 + 0x001a3> in <filename unknown>:0

What should I do? plz help.. tnx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.