grpc/client: HTTP CONNECT proxy support in transport#2698
Open
arjan-bal wants to merge 26 commits into
Open
Conversation
This reverts commit 0428123.
arjan-bal
added a commit
that referenced
this pull request
Jul 3, 2026
…ration (#2679) This PR implements a resolver wrapper that determines proxy routing by checking the `HTTPS_PROXY` and `NO_PROXY` environment variables. By default, `hyper-util` matches cURL's behavior by falling back to `ALL_PROXY` when `HTTPS_PROXY` is unset. However, because Go's [`FromEnvironment`](https://pkg.go.dev/golang.org/x/net/http/httpproxy#FromEnvironment) and gRPC C++ ignore `ALL_PROXY`, gRPC Rust manually configures the `Matcher` to bypass it, ensuring cross-language consistency. **Resolution Flow** When `HttpsProxyResolver::Builder` builds a resolver for a target URI, it uses `hyper_util::client::proxy::Matcher` to evaluate the environment variables: 1. **Direct Connection:** If no proxy is required, it delegates resolution entirely to the wrapped child builder, bypassing the proxy resolver. 2. **Proxied Connection:** If a proxy is required, it creates an `HttpsProxyResolver`, which uses the child DNS resolver to resolve the *proxy server's* hostname instead of the target. 3. **Attribute Injection:** The `HttpsProxyResolver` intercepts resolution updates from the child resolver. It attaches the necessary proxy configuration (the original target authority and basic auth credentials) as attributes to each resolved proxy address. In follow-up PRs, the subchannel will read these address attributes to wrap the channel credentials and carry out the HTTP `CONNECT` handshake prior to the standard credential handshake. Internal design doc: [go/grpc-rust-http-connect](http://go/grpc-rust-http-connect) Transport changes: #2698
1b5c061 to
bbde691
Compare
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.
This PR introduces an
HttpConnectHandshakerthat wraps theChannelCredentialsto complete the HTTP CONNECT handshake based on theAddressattributes introduced in #2679. This allows the subchannel to configure proxying transparently without requiring changes to the Transport API.