-
-
Save Raynos/cc0fefbeb5fa574a927f 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
httpProxy.createServer(function (req, res, proxy) { | |
var host = req.headers.host | |
, subdomain = host.split(".")[0] | |
, port | |
if (subdomain === "streams") { | |
port = 4001 | |
} else { | |
port = httpPort | |
} | |
proxy.proxyRequest(req, res, { | |
host: 'localhost', | |
port: port | |
}) | |
}).listen(httpProxyPort) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment