Allow creating H2C connections over HTTP CONNECT proxy tunnels#129485
Draft
MihaZupan wants to merge 1 commit into
Draft
Allow creating H2C connections over HTTP CONNECT proxy tunnels#129485MihaZupan wants to merge 1 commit into
MihaZupan wants to merge 1 commit into
Conversation
Member
Author
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
Contributor
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #99689