File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 6
6
module .exports = {
7
7
// ...
8
8
devServer: {
9
+ host: " 0.0.0.0" ,
9
10
client: {
10
- webSocketURL: " ws://localhost :8080" ,
11
+ webSocketURL: " ws://<insert-host> :8080" ,
11
12
},
12
13
},
13
14
};
@@ -16,9 +17,16 @@ module.exports = {
16
17
Usage via CLI:
17
18
18
19
``` console
19
- npx webpack serve
20
+ npx webpack serve --open --host 0.0.0.0 --client-web-socket-url ws://<insert-host>:8080
20
21
```
21
22
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
+
22
30
You're now able to explicitly define the protocol used with the ` client.webSocketURL ` option
23
31
(have a look at the config provided in ` webpack.config.js ` ).
24
32
You can’t perform that action at this time.
0 commit comments