0.9.3 • Published 5 years ago

ts-socks v0.9.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Socks5

npm version

A simple socks5 server written in typescript.

No dependencies

Javascript

const Socks5 = require('ts-socks');

new Socks5({
	options: {
		listen: 12345,
		allowNoAuth: true,
	},
	users: [{username: 'test', password: 'test'}],
}).on('connection', (proxy) => {

	console.log(proxy.remote.remoteAddress + ':' + proxy.remote.remotePort);
	proxy.origin.pipe(proxy.remote);
	proxy.remote.pipe(proxy.origin);
});

Typescript

import Socks5 from 'ts-socks';

new Socks5({
    options: {
        listen: 12345,
        allowNoAuth: true,
    },
    users: [{username: 'test', password: 'test'}],
}).on('connection', (proxy) => {

    console.log(proxy.remote.remoteAddress + ':' + proxy.remote.remotePort);
    proxy.origin.pipe(proxy.remote);
    proxy.remote.pipe(proxy.origin);
});