Remove http-proxy-node16, replace with lightweight inline proxy#7196
Remove http-proxy-node16, replace with lightweight inline proxy#7196ryancbahan wants to merge 1 commit into04-03-04-03-remove-network-interfacesfrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Add http-proxy.ts (~100 lines) implementing web() and ws() proxy methods using Node's built-in http/https modules. Handles HTTP request forwarding via pipe, and WebSocket upgrades via bidirectional socket piping with proper 101 Switching Protocols response. Includes 6 direct unit tests (GET/POST forwarding, header preservation, path forwarding, error callbacks for unreachable targets on both web and ws). Plus 8 existing integration tests via http-reverse-proxy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7008daf to
383b392
Compare
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
gonzaloriestra
left a comment
There was a problem hiding this comment.
I'm not sure about this change. I agree with replacing simple libraries with our own code, but this looks a bit complex (even if it's small)...
For example, some concerns by Claude that were apparently handled by the library:
- connection: 'close' on every proxied request — this disables keep-alive, which could add latency for repeated requests to the same backend during app dev. A battle-tested proxy library would handle connection pooling properly.
- Manual HTTP response construction in WS upgrade — writing raw
HTTP/1.1 101 Switching Protocols\r\n... strings is fragile. Edge cases around header formatting (multi-value headers, encoding) can cause subtle breakage. - No timeout handling — if a backend hangs, the proxy request will hang indefinitely.

Summary
http-proxy.ts(~100 lines) implementingweb()andws()proxy methods using Node's built-inhttp/httpsmoduleshttp-proxy-node16frompackages/app/package.jsonTophatting