Skip to content

Option to change port in webpackHotDevClient #2003

Closed
@dan-weaver

Description

@dan-weaver

Hi thanks for everyone's work on this project so far.

Quick question. I've run into some configuration woes wherein I need webpackHodDevClient to use a different port for the websocket connection Currently, it infers the information for the sockjs connection from window.location.port. The trouble I'm running into is that my index.html is being served from a different port than the webpack dev server is running on. For more specific background, I'm migrating from a configuration like this: http://jmfurlott.com/tutorial-setting-up-a-simple-isomorphic-react-app/. I have a small NodeJS server that acts as an oAuth client and provides a few endpoints to my react app. It therefore needs to serve index.html itself rather than serving the static index.html that ships with CRA.

I have already ejected, as my above use case is pretty specific. What I'm wondering is if CRA should provide some kind of option (I may be overlooking it) to affect this configuration within webpackHotDevClient or should it otherwise include the client in the ejected contents such as the scripts and config files.

Sorry if this is at all redundant I combed through issues and couldn't find anything quite like this. Also quite possible I'm not taking advantage of some features of CRA that may help me avoid this situation altogether?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions