Created
August 1, 2014 23:52
-
-
Save chyld/a8970bdf08ba172d3ea4 to your computer and use it in GitHub Desktop.
This file contains 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 = { | |
'chyld.io': 'http://localhost:3001', | |
'library.chyld.io': 'http://localhost:3002' | |
} | |
require('http').createServer(function(req, res) { | |
try{ | |
proxy.web(req, res, {target: options[req.headers.host]}, function(e){}); | |
}catch(e){ | |
} | |
}).listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment