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

Pass WDS_SOCKET options to webpack webSocketServer #13505

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acarapetis
Copy link

I've had trouble getting the WDS_SOCKET_PATH option to work with the react-scripts dev server - while the client was correctly attempting to connect to the path I specified, the backend was still just listening on /ws no matter what. Seems to be the same problem as #12092.

I've tracked it down to the configuration being provided to the webpack dev server. The websocket connection options were being provided only in the client.webSocketURL key, which tells the client where to connect but doesn't actually adjust where the dev server will be listening - that is specified in webSocketServer.options instead.

Making this change to webpackDevServer.config.js in my node_modules fixed the problem - after restarting the react dev server, the websocket was now listening at the correct path.

Previously these were being provided only in the `client.webSocketURL`
key, which tells the client where to connect but doesn't actually adjust
where the dev server will be listening.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants