Uh oh!
There was an error while loading. Please reload this page.
Allow creating H2C connections over HTTP CONNECT proxy tunnels - #129485
Conversation
MihaZupan
commented
Jun 16, 2026
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Tagging subscribers to this area: @karelz, @dotnet/ncl |
There was a problem hiding this comment.
Pull request overview
This PR updates SocketsHttpHandler’s proxy connection pooling so that cleartext HTTP/2 (h2c) requests sent via an HTTP(S) proxy can be carried over a CONNECT tunnel (similar to existing non-secure WebSocket proxy tunneling support), enabling HTTP/2 in scenarios that previously fell back to HTTP/1.1-only proxy forwarding.
Changes:
- Route cleartext HTTP/2 proxy requests to the
ProxyTunnelconnection kind (CONNECT tunneling) when HTTP/2 is required/preferred. - Enable HTTP/2 pooling/usage for
HttpConnectionKind.ProxyTunnel. - Add a functional test validating when CONNECT tunneling is used vs. absolute-form forwarding through the proxy.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs | Adds coverage for CONNECT tunneling behavior for HTTPS and cleartext HTTP/2 proxy scenarios. |
| src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPoolManager.cs | Adjusts connection key selection to use CONNECT tunneling for cleartext HTTP/2 through HTTP(S) proxies. |
| src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionKind.cs | Updates enum comments to reflect HTTP/1.1-only proxy forwarding vs. CONNECT tunneling use cases (including h2c). |
| src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionPool/HttpConnectionPool.Http2.cs | Allows pooled HTTP/2 connections for ProxyTunnel pools (debug invariant update). |
| src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionPool/HttpConnectionPool.cs | Enables HTTP/2 for ProxyTunnel pools by no longer force-disabling it in the constructor switch. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Closes#99689