Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom ports for websockets #40

Closed
ro-savage opened this issue Feb 11, 2020 · 0 comments · Fixed by #52
Closed

Allow custom ports for websockets #40

ro-savage opened this issue Feb 11, 2020 · 0 comments · Fixed by #52

Comments

@ro-savage
Copy link
Contributor

We run webpack through a rails application and a gem called webpacker

We there for run our webserver at one port, but our dev server on another port.

Because the websocket just uses window.localtion.port (https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/master/src/runtime/createSocket.js#L26) it tries to connect to our web server port, not our web socket port.

This could be fixed a few ways.

  1. You could allow a customer port to be passed to createSocket
  2. You could use the port that is specified in webpack-dev-server's config sockPort (https://webpack.js.org/configuration/dev-server/#devserversockport), with a fall back webpack-dev-servers port and finally a fall back to window.localtion.port

This may also solve #36

@ro-savage ro-savage changed the title Allow customer ports for websockets Allow custom ports for websockets Feb 11, 2020
@pmmmwh pmmmwh closed this as completed in #52 Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant