-
Notifications
You must be signed in to change notification settings - Fork 10
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
Do not add trailing slash to websocket path #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessarily a CRA exclusive fix, as what we're actually doing is exactly following the configuration provided by the user. This matches the handling of path
below when creating the HTTP reverse proxy. Hopefully this isn't too controversial.
Looking at usage of dev-nginx setup-app
across the organisation, I can't see any service that this change will negatively impact. In some cases, it'll actually make them easier to run!
I suspect the trailing Footnotes
|
Good find - so Michael figured this out ages ago! 😂 Shame he wasn't still on the team when I started digging into this |
When using Hot Module Reloading (HMR) with Create React App (i.e. WebPack under the hood), the WebSockets server is listening at
/sockjs-node
for CRA/WebPack v4:and at
/ws
for v5:Since dev-nginx adds a trailing slash to the nginx config, it fails to proxy these through correctly:
Removing the trailing slash fixes the issue: