cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.64k stars 1.12k forks source link

H2C support #66

Closed pomo-mondreganto closed 1 month ago

pomo-mondreganto commented 5 months ago

What is the problem your feature solves, or the need it fulfills?

It's currently impossible to use this project as TLS termination edge proxy in front of a cluster of non-TLS gRPC services.

Describe the solution you'd like

Non-TLS gRPC is basically http/2 without tls, so it'd be convenient if pingora supported h2c for both upstream and downstream connections.

Describe alternatives you've considered

It's currently non-feasible to implement such proxying with pingora, as it entails writing h2c protocol parsing.

Additional context

Most oss proxies support this feature (e.g. envoy, nginx).

xj524598 commented 2 months ago

any progress?

Object905 commented 2 months ago

Also will be useful in my use case, since I'm using pingora behind other proxy (ingress traefik) which supports h2c connections to services.

xj524598 commented 2 months ago

Also will be useful in my use case, since I'm using pingora behind other proxy (ingress traefik) which supports h2c connections to services.

pingora is better than ingress? how about use hyper?

Object905 commented 2 months ago

Pingora "too customizable" for use as ingress.I don't want to recompile whole router to add a service or write my own ingress controller. Waiting for river for this.

drcaramelsyrup commented 2 months ago

Right now we are open to having support for the feature but haven't been able to prioritize it yet.

andrewhavck commented 1 month ago

We've added support for server h2c in our latest sync, an example is here.

Switching protocols is todo, all downstream plaintext will go over H2 when this setting is enabled.

Downstream TLS -> Upstream plaintext doesn't need the h2c server setting, you only need to specify the min and max peer version is h2.