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

Setting a proxy in package.json attempts to tunnel the dev-server websocket, breaking it #7420

Closed
chancecarey opened this issue Jul 24, 2019 · 5 comments

Comments

@chancecarey
Copy link

Describe the bug

When setting a proxy setting in package.json, as expected this tunnels traffic to the proxy location, however it also seems to tunnel traffic like this:
/sockjs-node/858/hjulxq2g/websocket. As expected, auto refresh on updating my app no longer works.

Did you try recovering your dependencies?

Yes. Deleting and rebuilding made no difference.

Which terms did you search for in User Guide?

Environment

Environment Info:

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  Binaries:
    Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.17763.1.0
    Internet Explorer: 11.0.17763.592
  npmPackages:
    react: ^16.8.6 => 16.8.6
    react-dom: ^16.8.6 => 16.8.6
    react-scripts: 3.0.1 => 3.0.1
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. Create a react app
  2. Add "proxy": "http://localhost:8000/" to package.json
  3. Observe console - The connection to wss://localhost/sockjs-node/264/ludnoeal/websocket was interrupted while the page was loading.

Expected behavior

This worked fine for the past two weeks or so, but it doesn't seem to work anymore today. I expect it to proxy all traffic except for the sockjs-node endpoint as this breaks webpack-dev-server.

Actual behavior

All traffic is proxied, including sockjs-node endpoints.

@dmile
Copy link
Contributor

dmile commented Jul 24, 2019

Looks like a duplicate of #6720
Try a different browser or manual proxy configuration

@chancecarey
Copy link
Author

Looks like a duplicate of #6720
Try a different browser or manual proxy configuration

No, I don't believe so. In the logs of the server the proxy points to, I see the exact endpoints that were forwarded that shouldn't have been - specifically /sockjs-node. As in, those requests do get proxied when they shouldn't be.

@chancecarey
Copy link
Author

After further digging it seems this issue occurs on Firefox, but not on Chrome.

@dmile
Copy link
Contributor

dmile commented Aug 10, 2019

@cmcarey The new version of react-scripts was released. Please udate your project to:

"react-scripts": "3.1.0"

@chancecarey
Copy link
Author

Thanks!

For posterity, issue was fixed in #7444

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants