Skip to content

Instantly share code, notes, and snippets.

@MrFrankel
Created January 12, 2017 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrFrankel/db0ea3c7989469a0b74f06180a3512ea to your computer and use it in GitHub Desktop.
Save MrFrankel/db0ea3c7989469a0b74f06180a3512ea to your computer and use it in GitHub Desktop.
https.createServer(credentials, function (req, res) {
Object.keys(options.routingTable).some(function (key) {
const regX = new RegExp(key);
if (regX.test(req.url)) {
printMe(req.url + ' => ' + (options.routingTable[key].targetName || options.routingTable.target));
proxy.web(req, res, options.routingTable[key]);
curTarget = options.routingTable[key];
return true;
}
});
}).listen(options.home_port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment