Skip to content

Support address rewriting proxy mapper #10022

Open
@ejona86

Description

@ejona86

gRFC A1 describes HTTP CONNECT support. grpc-java has supported "Use case 1" to one level or another since v1.0.3. There's been some ways to do "use case 2" (and 3), but these needed custom name resolvers and Netty ProtocolNegotiators for other reasons, and they could do what they needed without any direct support in grpc-java.

We're seeing some new cases for "use case 2." The important part of that case is the client is aware of backends so can load balance between them. Name resolution is generally not DNS, and may actually use a "use case 1" approach to get addresses.

We need to add an API, at least to Netty, to choose to use a proxy on a per-address basis. We can potentially use the ProxyDetector API for this, but we'd call it with resolved SocketAddresses instead of the normal unresolved addresses. I don't know if that's a good idea or not, also because ProxyDetector can block and we probably can't block in the usage here for Netty.

The implementation for this can be a Netty protocol negotiator that wraps the real negotiator if the builder was configured with one of these per-address mappers. It probably can reuse large portions of ProtocolNegotiators.httpProxy().

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions