New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add header support to HttpConnectProxiedSocketAddress #9826
Comments
HAProxy on client-side is very strange. I'm not aware of any client implementing it; it is intended for proxies. Isn't it much more straight-forward to extend HTTP CONNECT to allow other headers? But that does lead to the question, "why do you need headers?" You don't actually say you need them, you just say the API is "weak." What functionality is it not able to provide? What is your use-case? |
Yeah, commonly grpc client specify the network name for resolvers, and service/method/attributes so that are materialized in the http2 stream headers.
The proxy protocol or HTTP 1.1. CONNECT is used to deliver the attributes for all the GRPC requests transported in the TCP connection. I need them as the key to the load balance the served TCP connections, just as a common http2 proxy can dispatch each GRPC request according to the method.
What I demand is
Whichever H1 CONNECT or HA proxy protocol is decided, I wish GRPC client can have some API/config so that the Negotiator could populate the key values provided by the client API.
|
Regarding the headers, the candidates are caller, callee, and location such as host name and clusters. The headers are not IP addresses that are only tenant supported by HA proxy protocol v1. |
Does every request from a particular client use the same settings, or do they vary per-RPC and you need to route each RPC (on the client-side) to the correct tunnel?
I don't understand what you mean here; I don't know what impact the attributes have to resolvers. Is the cardinality of the attributes or the attribute values which is high?
Caller might not be too ugly to put as the username, if you really had to. Callee, location, hostname, and clusters are generally encoded in the hostname passed to CONNECT. For example, you could use To extend gRPC to allow other headers, we'd add an immutable headers map to HttpConnectProxiedSocketAddress for a NameResolver to use. We'd then pass the headers to a different Netty constructor. |
The grpc client should group the rpc-calls so that all the rpc calls in the channel share the same setting.
Sorry for the unclear. The number of all possible values combinations is high.
Yeah, encoded these info into host name is what I am hacking.
Thank you! I also find this proxy detector is embedded in name resolution. It's likely I would extend the |
@lambdai, are you offering to implement this feature or requesting that the gRPC team add it? |
@larry-safran I am happy to extend the ProxiedAddress, which is the HTTP 1 CONNECT solution. GIven this solution is not aligned with the original HAProxy protocol, I'd like to create a new issue. WDYT? |
Adding a Netty (and potentially OkHttp) could be enhanced to read the header field from the |
Title
Can we add haproxy protocol at client side aside from server side proxy protocol (#8949) ?
Motivation
HTTP2 parser may not be trivial in a simple proxy. I experimented the codec of Envoy.
A TCP proxy reaches 8-10x throughput vs HTTP2 proxy because TCP proxy does not parse and materialize HTTP2 structures such as header. However, a reasonable TCP proxy wants more than TCP addresses to determine the route.
The HAProxy protocol can deliver resourceful attributes via TLV fields. It would be great if GRPC channel could support adding channel-wide attributes.
There is a Negotiator can be used to achieve "self-defined TCP payload ahead of H2 channel".
Alternative
Currently, only HTTP 1.1 CONNECT (aka https proxy) is offered in the GRPC channel, with a weak API.
E.g. only user and password are supported to define the HTTP1.1 CONNECT request, while HTTP1 supports any legit HTTP header names and values.
The text was updated successfully, but these errors were encountered: