1.0.7 • Published 6 years ago

@outtacontrol/socks-router v1.0.7

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

Universal Router

Easier way to add routing functionality on top of the socks5 webserver.

const { createServer } = require("@outtacontrol/socks");

const { createRouter } = require("./lib/index");
const { blacklist } = require("./lib/validators/blacklist");
// const { whitelist } = require("./lib/validators/blacklist");

const app = createRouter();

app.use(blacklist(['example1.com', 'example2.com:80']));
// app.use(whitelist(['example1.com', 'example2.com:80']));

// app.use({
//     uri: {hostname: "...", port: "8080"},
//
//     async initialize() {
//         // ... some initialization code (only executed once before an action takes place on the route)
//     },
//     async validate(info) {
//         // // no return or empty return is just continuing the loop
//         // return true; // executes the interception method
//         // return false; // denies access
//     },
//     asnyc intercept(info, socket) {
//         // do something with the socket...
//     }
// });

const server = createServer({ auths: [auth.None()] }, app.getHandler());
server.listen(1080, "localhost", () => {
    console.log("socks5 router is listening on port 1080");
});
1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago