Skip to content

Commit

Permalink
adding support for setting the host
Browse files Browse the repository at this point in the history
  • Loading branch information
shapeshed committed Jun 20, 2012
1 parent ccd8f84 commit 06e78f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/node-http-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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;

//
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 06e78f2

Please sign in to comment.