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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions