Skip to content

Commit

Permalink
add host argument for packager.
Browse files Browse the repository at this point in the history
Summary:
Now packager only listen to "::", which is IPv6 "Any address".
It failed to run in IPv4 Environment.

defaults to undefined or empty string will fix this.

And I think it's necessary to let user define host by cli argument.

It's also for security reason. When working on a public network, it's much safer to listen with localhost instead of ::, which may let everyone in same network be able to get your code from debugger-ui.

recommit for facebook#1918, fixes facebook#2441
Closes facebook#5377

Reviewed By: svcscm

Differential Revision: D2842594

Pulled By: martinbigio

fb-gh-sync-id: 575944c5469dac80e99136a7903ea99f5339dba1
  • Loading branch information
DengYun authored and christopherdro committed Jan 20, 2016
1 parent bf9b9a0 commit 858caa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion local-cli/server/runServer.js
Expand Up @@ -44,7 +44,7 @@ function runServer(args, config, readyCallback) {

const serverInstance = http.createServer(app).listen(
args.port,
'::',
args.host,
function() {
attachHMRServer({
httpServer: serverInstance,
Expand Down
4 changes: 4 additions & 0 deletions local-cli/server/server.js
Expand Up @@ -30,6 +30,10 @@ function _server(argv, config, resolve, reject) {
command: 'port',
default: 8081,
type: 'string',
}, {
command: 'host',
default: '',
type: 'string',
}, {
command: 'root',
type: 'string',
Expand Down

0 comments on commit 858caa9

Please sign in to comment.