Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace 0.0.0.0 with localhost on open #725

Closed
wants to merge 4 commits into from
Closed

Replace 0.0.0.0 with localhost on open #725

wants to merge 4 commits into from

Conversation

mstijak
Copy link

@mstijak mstijak commented Dec 28, 2016

Summary
It's common to set host: '0.0.0.0' to enable access to the development server from the network, but that doesn't play well if open: true is set.
Chrome displays an error instead of the application.

The fix is simple. Replace 0.0.0.0 with localhost before passing the URL to the browser.

Does this PR introduce a breaking change?
No

Other information
See http://superuser.com/questions/846721/chrome-wont-access-http-0-0-0-04200.

@jsf-clabot
Copy link

jsf-clabot commented Dec 28, 2016

CLA assistant check
All committers have signed the CLA.

@korotkin
Copy link

korotkin commented Jan 5, 2017

npm start -- --host 0.0.0.0

@mstijak
Copy link
Author

mstijak commented Jan 8, 2017

@korotkin
This PR fixes the probem if you use --open and --host 0.0.0.0. 0.0.0.0 is not a valid IP address and Chrome refuses to open it.

npm start --host 0.0.0.0 --open

@SpaceK33z
Copy link
Member

I merged #746, so it's now possible to add --public localhost and it will use the correct URL to open the site. It's a bit more config, but you can't always assume that it works correctly for localhost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants