Skip to content

Instantly share code, notes, and snippets.

@speedygfw
Last active August 29, 2015 13:57
Show Gist options
  • Save speedygfw/9527929 to your computer and use it in GitHub Desktop.
Save speedygfw/9527929 to your computer and use it in GitHub Desktop.
My simple NodeJS proxy
var httpProxy = require('http-proxy')
var proxy = httpProxy.createProxy();
var options = {
'pad.fwallenborn.de': 'http://localhost:9001',
'spielfeld24.de': 'http://localhost::8000'
}
require('http').createServer(function(req, res) {
proxy.web(req, res, {
target: options[req.headers.host]
}, function(e){
console.log(e);
});
}).listen(80);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment