Skip to content

Instantly share code, notes, and snippets.

View justin-p's full-sized avatar
:shipit:

Justin Perdok justin-p

:shipit:
View GitHub Profile
@justin-p
justin-p / socks5.js
Created January 30, 2024 14:13 — forked from longbill/socks5.js
Socks5 proxy server in pure javascript
const net = require('net')
net.createServer(client => {
client.once('data', data => {
client.write(Buffer.from([5, 0]));
client.once('data', data => {
data = [...data];
let ver = data.shift();
let cmd = data.shift(); //1: connect, 2: bind, 3: udp
let rsv = data.shift();