I am currently trying to get webpack-dev-server
working with hot loading, through boot2docker.
I have files changes being picked up correctly in my container, by using docker-osx-dev
, but the socket.io hot reloading is not working.
The reason being that I set --host 0.0.0.0
when running the server, so that it would be accesible on my host machine. This meant, however, that it is looking for the socket.io server at 0.0.0.0
.
So when I load the page, it tries to connect to http://0.0.0.0:8080/socket.io/?EIO=3&transport=polling&t=1434584701670-0
and I get an error in my consul. In reality it should be connecting to http://dockerhost:8080/socket.io/
.
Is there anyway to tell webpack-dev-server
to use a different host to get the socket.io connection?
The Github issue 63 may refer to the same problem, but is unresolved.
So I realized that even though it was giving me an error in the console, by trying to connect to the wrong host, it was also connecting to the right host so hot loading did work.
In the end, my config looked something like this:
and I started it like this:
For a full example, check out my the initial stages of my app that just has this boilerplate + react