Proxy WebSocket connections with error handling
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.
- [x] Provide tests for the changes (unless documentation-only)
- [x] Documented any new features, CLI switches, etc. (if applicable)
- [x] Server
--helpoutput - [x] README.md
- [x] doc/http-server.1 (use the same format as other entries)
- [x] Server
- [x] The pull request is being made against the
masterbranch
Maintainer checklist
- [ ] Assign a version triage tag
- [ ] Approve tests if applicable
This pull request has been inactive for 360 days