Skip to content

Allow custom ports for websockets #40

Closed
@ro-savage

Description

@ro-savage

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions