webpack-dev-server: V3.3.0 live reload broken when set hostname to `0.0.0.0:xxxx`
-
Operating System: MacOS
-
Node Version: v10.15.0
-
NPM Version: 6.4.`
-
webpack Version: 4.29.6
-
webpack-dev-server Version: 3.3.0
-
This is a bug
-
This is a modification request
Code
When start a node server like 0.0.0.0:8080, and load resources from 0.0.0.0:9000
, Port was reset to self.location.port
, which actually is 8080.
For Bugs; How can we reproduce the behavior?
- Start webpack-dev-server and listen at e.g. 0.0.0.0:9000
- Load resources from another local server like: 0.0.0.0:8080
Expected Behavior
Live reload should listen 0.0.0.0:9000
Actual Behavior
Live reload listen 0.0.0.0:8080
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 14
- Comments: 39 (23 by maintainers)
Commits related to this issue
- chore: update deps — committed to vuejs/vue-cli by sodatea 5 years ago
- Revert "build(deps-dev): bump webpack-dev-server from 3.2.1 to 3.3.1" This reverts commit beaa1f574c91aa875877ef0f42226987f0612dd1. Until https://github.com/webpack/webpack-dev-server/issues/1777 is... — committed to MarkUsProject/Markus by david-yz-liu 5 years ago
- fix(client-src): don't use self.location.port ISSUE: https://github.com/webpack/webpack-dev-server/issues/1777 REF: https://github.com/webpack/webpack-dev-server/pull/1792 REF: https://github.com/web... — committed to webpack/webpack-dev-server by hiroppy 5 years ago
- fix(client-src): don't use self.location.port ISSUE: https://github.com/webpack/webpack-dev-server/issues/1777 REF: https://github.com/webpack/webpack-dev-server/pull/1792 REF: https://github.com/web... — committed to webpack/webpack-dev-server by hiroppy 5 years ago
- fix(client-src): don't use self.location.port ISSUE: https://github.com/webpack/webpack-dev-server/issues/1777 REF: https://github.com/webpack/webpack-dev-server/pull/1792 REF: https://github.com/web... — committed to webpack/webpack-dev-server by hiroppy 5 years ago
- fix(client-src): don't use self.location.port ISSUE: https://github.com/webpack/webpack-dev-server/issues/1777 REF: https://github.com/webpack/webpack-dev-server/pull/1792 REF: https://github.com/web... — committed to webpack/webpack-dev-server by hiroppy 5 years ago
- fix(client-src): don't use self.location.port (#1838) ISSUE: https://github.com/webpack/webpack-dev-server/issues/1777 REF: https://github.com/webpack/webpack-dev-server/pull/1792 REF: https://gith... — committed to webpack/webpack-dev-server by hiroppy 5 years ago
my pr can fix your problem and you can also start your app by webpack-dev-server --port 8080 make it get the true port. because it use location.port if your urlParts.port is undefined but at this time ,you can’t add sockPath in your option, because here if my pr is merge, you can set sockPort by webpack-dev-server --sockPort 8080
Install dependencies and
npm run dev
Visit: http://127.0.0.1:8080/
See network inspect, will get:
Yes, release will be on this week
@pedrofurtado This fix will be fixed in the next version and the next version will be released in this week.
Oh, yes we don’t have sockHost now, i mean
sockPath
, if somebody needed insockHost
you can send a PR, it is easy@hiroppy yep, some busy in this week, feel free to do this