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

Use localhost instead of 0.0.0.0 for webpack-dev-server #431

Closed
wants to merge 1 commit into from

Conversation

catskull
Copy link

@catskull catskull commented May 26, 2017

Resolves #424

@renchap
Copy link
Contributor

renchap commented May 27, 2017

A bit of explanations here:
0.0.0.0 is a special IP address. It should only be used in an HTTP server setting: listening on 0.0.0.0 means listening on all IP addresses available on the system: your LAN IP address, localhost (127.0.0.1), …

It should never be used to connect to an HTTP server. You need to use a proper IP address, like localhost/127.0.0.1, your server's public IP, …

From what I understand, dev_server.host is used to configure both the IP webpack-dev-server listens to (so 0.0.0.0 is correct here) and the host used to create assets URLs (and 0.0.0.0 must not be used here).

This setting should be split in two, maybe host and listen_address.

For local development, we can have:

host = 'localhost'
listen_address = 'localhost' # or 0.0.0.0

For remote development (for example Cloud9, the use case which prompted this change), we can use:

host = '<Cloud9 environment public IP>' # The one you use in your browser to
                                        # connect to your Rails server
listen_address = '0.0.0.0' # Webpack needs to listen on all addresses

@gauravtiwari
Copy link
Member

Superseded by #482

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.

3 participants