File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66module .exports = {
77 // ...
88 devServer: {
9+ host: " 0.0.0.0" ,
910 client: {
10- webSocketURL: " ws://localhost :8080" ,
11+ webSocketURL: " ws://<insert-host> :8080" ,
1112 },
1213 },
1314};
@@ -16,9 +17,16 @@ module.exports = {
1617Usage via CLI:
1718
1819``` console
19- npx webpack serve
20+ npx webpack serve --open --host 0.0.0.0 --client-web-socket-url ws://<insert-host>:8080
2021```
2122
23+ _ NOTE: replace ` <insert-host> ` with your local IP Address._
24+
25+ In order to make the server publicly accessible the client needs to know with
26+ what host to connect to the server. If ` --host 0.0.0.0 ` is given, the client
27+ would try to connect to ` 0.0.0.0 ` . With the ` --client-web-socket-url ` and related options it is possible to
28+ override this.
29+
2230You're now able to explicitly define the protocol used with the ` client.webSocketURL ` option
2331(have a look at the config provided in ` webpack.config.js ` ).
2432
You can’t perform that action at this time.
0 commit comments