From 06e78f27475165d023fd66afbe5dd626a6a548af Mon Sep 17 00:00:00 2001 From: George Ornbo Date: Wed, 20 Jun 2012 15:51:31 +0100 Subject: [PATCH] adding support for setting the host --- bin/node-http-proxy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/node-http-proxy b/bin/node-http-proxy index 87de8bb5f..0ffd1274d 100755 --- a/bin/node-http-proxy +++ b/bin/node-http-proxy @@ -13,6 +13,7 @@ var help = [ "", "options:", " --port PORT Port that the proxy server should run on", + " --host HOST Host that the proxy server should run on", " --target HOST:PORT Location of the server the proxy will target", " --config OUTFILE Location of the configuration file for the proxy server", " --silent Silence the log output from the proxy server", @@ -25,6 +26,7 @@ if (argv.h || argv.help || Object.keys(argv).length === 2) { var location, config = {}, port = argv.port || 80, + host = argv.host || undefined, target = argv.target; // @@ -77,7 +79,11 @@ else { // // Start the server // -server.listen(port); +if (!host) { + server.listen(port); +} else { + server.listen(port, host); +} // // Notify that the server is started