fix: auto-detect HTTP proxy tunneling#5116
Conversation
be4138f to
d6abdf6
Compare
|
Should - setGlobalDispatcher(new EnvHttpProxyAgent())
+ setGlobalDispatcher(new EnvHttpProxyAgent({ proxyTunnel: true })) |
|
Thanks for submitting this! Do we have a sense of when this might make it into to a published branch? The reason I ask is that we're trying to replace request with fetch, but our outbound proxy rejects CONNECT requests for https so this is a blocker... trying to decide whether to revert all of it and go back to request we're in a deployable state, or if it's reasonable to wait for this change. |
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
ed8fadc to
b6a6e97
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5116 +/- ##
=======================================
Coverage 93.23% 93.23%
=======================================
Files 110 110
Lines 36575 36579 +4
=======================================
+ Hits 34099 34106 +7
+ Misses 2476 2473 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I investigated the remaining CI failures after the rebase. All regular undici jobs are passing. The only failures left are the What is happening there:
I checked
That last file is especially telling because it currently expects:
So the failing shared-builtin jobs are not showing an undici regression in the main test matrix; they are showing that Node's fetch-side proxy tests need to be updated to match the new behavior. I think the follow-up should be a |
This relates to...
Fixes #5093
Rationale
EnvHttpProxyAgentcurrently inheritsProxyAgent's tunneling behavior. For plain HTTP targets reached through an HTTP proxy, defaulting to CONNECT can break proxies that do not implement tunneling and can lead to the looping behavior reported in #5093.Changes
ProxyAgentproxyTunnel: trueas an explicit overrideEnvHttpProxyAgentusinghttp_proxyFeatures
N/A
Bug Fixes
EnvHttpProxyAgentcase behind Use of HTTP_PROXY & NODE_USE_ENV_PROXY fails with an infinite loop #5093 by avoiding CONNECT for that setup unless explicitly requestedBreaking Changes and Deprecations
None
Status