Fixed the hmr connection with host 0.0.0.0 #7357
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
↪️ Pull Request
As well known the server listen host should not be equal to the client connect to, but
@parcel/runtime-browser-hmr
is doing so.We usually use
0.0.0.0
as the host to make sure the service is listening to all of the network interfaces, but '0.0.0.0' must not be the client connect to.💻 Examples
Start the parcel with
parcel --host 0.0.0.0 --port 8081 ./demo/index.html
in remote dev machine, then start the web browser to connect will got following error message:Applied the patch, the
HMR_HOST
set tonull
, and the WebSocket connect correctly.✔️ PR Todo