Socket
Socket
Sign inDemoInstall

@outtacontrol/socks-router

Package Overview
Dependencies
5
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @outtacontrol/socks-router

routes requests on the socks v5 server.


Version published
Weekly downloads
4
Maintainers
1
Install size
3.85 MB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 30 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc