Skip to content
This repository was archived by the owner on Dec 24, 2021. It is now read-only.

phoenix344/socks-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A wrapper on top of the socksv5 server to attach multiple components more easily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors