Navigation Menu

Skip to content

Commit

Permalink
Introduce -localhost resp. -l abbreviation
Browse files Browse the repository at this point in the history
This increases the chances of lazy people still using a security-relevant
setting.
  • Loading branch information
gagern authored and rvagg committed Jun 29, 2016
1 parent cc20690 commit 128c6fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -188,6 +188,8 @@ Options:
-H --host HOST Bind address HOST (default=*)
-l --localhost Same as "--host localhost"
-d --dir DIRECTORY Serve the contents of DIRECTORY (default=cwd)
-u --url MOUNTURL Serve the contents at MOUNTURL mount path (default=/)
Expand Down Expand Up @@ -281,6 +283,6 @@ traversal, then you are encouraged to please refactor so that you do
not depend on having `..` in url paths, as this tends to expose data
that you may be surprised to be exposing.

Consider using the `--host localhost` setting if you don't want other
Consider using the `--localhost` setting if you don't want other
people on your local network to read the files served by the command
line server. This may become the default in a future major version.
7 changes: 7 additions & 0 deletions bin/server.js
Expand Up @@ -27,6 +27,11 @@ for (var i = 2; i < process.argv.length; i++) {
}
break

case '-l':
case '--localhost':
host = 'localhost'
break

case '-d':
case '--dir':
dir = process.argv[++i]
Expand Down Expand Up @@ -108,6 +113,8 @@ function help () {
,''
,'-H --host HOST Bind address HOST (default=*)'
,''
,'-l --localhost Same as "--host localhost"'
,''
,'-d --dir DIRECTORY Serve the contents of DIRECTORY (default=cwd)'
,''
,'-u --url /url Serve at this mount url (default=/)'
Expand Down

0 comments on commit 128c6fd

Please sign in to comment.