Last active
August 29, 2015 13:57
-
-
Save speedygfw/9527929 to your computer and use it in GitHub Desktop.
My simple NodeJS proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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