Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #1013
Closed
Open
Issue created Nov 06, 2016 by Administrator@rootContributor

Websockets can be proxied, but the method is undocumented

Created by: dceddia

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

Yes

Description

I was trying to proxy Websockets through the "proxy" feature built into CRA. With a proxy setting of "http://localhost:4000" (an express server), the Websocket doesn't work. However, with a URL of "ws://localhost:4000", the Websockets do work! 😄 (along with regular HTTP requests). According to the underlying http-proxy-middleware library, this is supported.

This is great. So why file this issue? There are 2 conflicting pieces of info in CRA:

  • This comment in start.js implies Websockets are supported.
  • The README / User Guide says "Currently the proxy option only handles HTTP requests, and it won’t proxy WebSocket connections."

I'd be happy to submit a PR with these changes.

Expected behavior

The README should advertise Websocket proxying with the "ws://" prefix, and the comment in start.js should probably be updated to mention the prefix too.

Actual behavior

The current docs about Websockets undersell the actual functionality 😄

Environment

This isn't environment-related.

Assignee
Assign to
Time tracking