npm

ts-socks
TypeScript icon, indicating that this package has built-in type declarations

0.9.3 • Public • Published

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);
});

Package Sidebar

Install

npm i ts-socks

Weekly Downloads

1

Version

0.9.3

License

MIT

Unpacked Size

19.5 kB

Total Files

12

Last publish

Collaborators

  • jaenster