Skip to content

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

Closed
@chancecarey

Description

@chancecarey

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.

Activity

dmile

dmile commented on Jul 24, 2019

@dmile
Contributor

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

chancecarey

chancecarey commented on Jul 24, 2019

@chancecarey
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

chancecarey commented on Aug 5, 2019

@chancecarey
Author

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

dmile

dmile commented on Aug 10, 2019

@dmile
Contributor

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

"react-scripts": "3.1.0"
chancecarey

chancecarey commented on Aug 12, 2019

@chancecarey
Author

Thanks!

For posterity, issue was fixed in #7444

locked and limited conversation to collaborators on Aug 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dmile@bugzpodder@chancecarey

        Issue actions

          Setting a proxy in package.json attempts to tunnel the dev-server websocket, breaking it · Issue #7420 · facebook/create-react-app