question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to send hot updates through Unix socket?

See original GitHub issue

version: 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:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
resurecommented, Dec 6, 2016

Typically, I’m using dev server in socket mode together with nginx:

  • nginx is being configured to pass all /webpack/* and /sockjs-node/* to webpack-dev-server
  • webpack-devserver itself is starting with --public=0.0.0.0 option, so hmr client fallbacks to self.location.hostname which is correct value for this usecase
  • Everything is still on one host so no additional configuration for CORS required

@everthis can you please explain what is your usecase? How do you connecting to that socket?

1reaction
everthiscommented, Dec 8, 2016

@resure Thanks, the --public host:port option really works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

File Descriptor Transfer over Unix Domain Sockets
Transferring TCP sockets over a Unix domain socket is, actually, a tried and tested method to implement “hot restarts” or “zero downtime ...
Read more >
How can I communicate with a Unix domain socket via the ...
I'm running a Debian Squeeze web server. I've installed memcached on it, and configured memcached to ...
Read more >
How can I send messages to an existing Unix socket from ...
I want to send messages to an existing Unix socket (to control mpv via its JSON IPC interface). I see there was a...
Read more >
DogStatsD over Unix Domain Socket - Datadog Docs
To set up DogStatsD with Unix Domain Socket, enable the DogStatsD server through the dogstatsd_socket parameter. Then, configure the DogStatsD client in your ......
Read more >
[RFC,net-next,x86,0/6] Nontemporal copies in unix socket ...
In this case, the HTTP daemon can use splice to move data from the unix > socket connection with storageD directly to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found