Skip to content

Conversation

@Hermholtz
Copy link
Contributor

Properly proxy WebSocket "upgrade" connections. Without this change any attempt to use http-server as a proxy for WebSocket does not work. The code also handles error cases when WebSocket server abruptly closes connection (or a network device dies between client and server). Other PRs fixing the same issue cause http-server to throw error and exit on WebSocket connection errors.

It's a useful addition to http-server for people developing WebSocket applications. There's no WebSocket proxy for Node.js easy to use from command line. This pull request makes http-server more versatile and helps local dev workflows.

The change is as minimal as possible, no code style changes, no whitespace changes etc. Please merge.

Relevant issues

Fixes #142.

Contributor checklist

Note: cannot provide unit tests for this change.
Note: this doesn't add any new command line options.

  • Provide tests for the changes (unless documentation-only)
  • Documented any new features, CLI switches, etc. (if applicable)
    • Server --help output
    • README.md
    • doc/http-server.1 (use the same format as other entries)
  • The pull request is being made against the master branch
Maintainer checklist
  • Assign a version triage tag
  • Approve tests if applicable

@github-actions
Copy link

This pull request has been inactive for 360 days

@KernelDeimos KernelDeimos merged commit 9d7dd6b into http-party:master Aug 6, 2025
This was referenced Oct 17, 2025
rafiibrahim8 pushed a commit to rafiibrahim8/http-server that referenced this pull request Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebSockets not supported in proxy mode

2 participants