4.5.2 • Published 4 months ago

socks5server v4.5.2

Weekly downloads
15
License
MIT
Repository
github
Last release
4 months ago

SOCKS v4/v4a/v5 server implementation with user/pass authentication node.js

A simple SOCKS v5/v4/v4a server implementation and a demo proxy.

You can launch a demo proxy server easily :

node proxy.js [options]

This will create a proxy server default at 127.0.0.1:1080.

options: see node proxy.js --help

Install

npm install socks5server

Embed the server in your project

You may need socks protocol knowledge to use this one in your project, or refer to the proxy.js demo.

const socks5server = require('socks5server');

var server = socks5server.createServer();
//or
//var server = new socks5server.socksServer();

server
.on('tcp',(socket, address, port, CMD_REPLY)=>{
	//do something with the tcp proxy request
}).on('udp',(socket, expectClientAddress, expectClientPort, CMD_REPLY)=>{
	//do something with the udp proxy request
}).on('error', function (e) {
	console.error('SERVER ERROR: %j', e);
}).on('client_error',(socket,e)=>{
	console.error('  [client error]',`${net.isIP(socket.targetAddress)?'':'('+socket.targetAddress+')'} ${socket.remoteAddress}:${socket.targetPort}`,e.message);
}).on('socks_error',(socket,e)=>{
	console.error('  [socks error]',`${net.isIP(socket.targetAddress)?'':'('+(socket.targetAddress||"unknown")+')'} ${socket.remoteAddress||"unknown"}}:${socket.targetPort||"unknown"}`,e);
}).listen(1080, "127.0.0.1");

/*
What is 'CMD_REPLY'?
	CMD_REPLY(replyCode,addr,port)
	see https://www.ietf.org/rfc/rfc1928.txt @page5:"6 Replies" for details
*/

The proxy.js is a simple demo of the server.

Implementations

✅ : OK ❌ : not implemented ❓ : I'm not sure is it completely finished

Socks4

Socks4a

Socks5

  • address ipv4 ✅ ipv6 ✅ * domain name ✅

  • auth methods no auth ✅ userpass ✅ GSSAPI ❌ iana assigned ❌ * private methods ✅ (use as a module)

  • CMD connect ✅ udp ✅ (maybe usable) fragment ❌ (no plan on it) bind ❌

RFC:

License

(The MIT License)

This repo was forked from https://github.com/gvangool/node-socks/

4.5.2

4 months ago

4.5.0

2 years ago

4.5.1

2 years ago

4.4.1

2 years ago

4.3.2

2 years ago

4.2.3

2 years ago

4.4.0

2 years ago

4.3.1

2 years ago

4.2.2

2 years ago

4.4.2

2 years ago

4.1.0

2 years ago

4.3.0

2 years ago

4.2.1

2 years ago

4.2.0

2 years ago

4.0.12

6 years ago

4.0.11

6 years ago

4.0.10

6 years ago

4.0.9

6 years ago

4.0.8

6 years ago

4.0.7

6 years ago

4.0.6

6 years ago

4.0.5

6 years ago

4.0.4

6 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.1.4

6 years ago

3.1.3

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago