Skip to content

Instantly share code, notes, and snippets.

@bardiarastin
Created August 11, 2018 08:46
Show Gist options
  • Save bardiarastin/2f026ae43d471ef92bd21b4d36110497 to your computer and use it in GitHub Desktop.
Save bardiarastin/2f026ae43d471ef92bd21b4d36110497 to your computer and use it in GitHub Desktop.
const ProxyChain = require('proxy-chain');
const server = new ProxyChain.Server({
port: 8000,
verbose: false,
prepareRequestFunction: ({ request, username, password, hostname, port, isHttp }) => {
return {
requestAuthentication: username !== 'myusername' || password !== 'mypassword'
};
},
});
server.listen(() => {
console.log(`Proxy server is listening on port ${8000}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment