Is there a way to send hot updates through Unix socket?
See original GitHub issueversion: 2.1.0-beta.12
use case:
Webpack-dev-server runs on remote machine and cooperate with remote backend server(the backend server has been bound to unix socket ), And the entry of the whole webapp is something like this http://10.0.0.9:8678.
I noticed that the 2.1.0-beta.12 version webpack-dev-server can serve bundles through Unix socket with CLI like this --socket shared/sockets/webpack.sock , but the HMR part will need to set host and port.
If I leave the HMR configuration part as defaults, It will send request like this:
http://localhost/sockjs-node/info?t=1480337410648
,which won’t work since the server is http://10.0.0.9:8678 and not http://localhost
I can set the HMR part like this webpack-dev-server/client?http://0.0.0.0:8679 and do some server configuration to eliminate the CORS error. But this is not elegant.
Is there a way to bind the HMR to unix socket so that there is no need to set host and post and do CORS server config?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
Typically, I’m using dev server in socket mode together with nginx:
/webpack/*and/sockjs-node/*to webpack-dev-server--public=0.0.0.0option, so hmr client fallbacks toself.location.hostnamewhich is correct value for this usecase@everthis can you please explain what is your usecase? How do you connecting to that socket?
@resure Thanks, the
--public host:portoption really works.