cloudflare / pingora

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

HAProxy PROXY protocol v1/v2 support #132

Open thepapanoob opened 3 months ago

thepapanoob commented 3 months ago

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

its a quite common usecase to have pingora behind a loadbalancer when running inside of cloud infrastructure. They usually implement the PROXY protocol to give information about the TCP session like the connection initiator, connection target, client & server and the proxy. It would be immensly helpful to have those informations on pingora's side.

Describe the solution you'd like

Implement the PROXY protocol as decribed in the docs from HAProxy itself. Otherwise there are some rust based implementations floating around that could speedup the process.

example 1 example 2 example 3 example 4

Describe alternatives you've considered

The other solution would be to use mmproxy but that makes it quite inflexible and brings other challenges in itself.

Thank you for this awesome project. 👍

kingprimex commented 3 months ago

We need this for on premise infrastructure . Currently using HAPROXY with proxy protocol in front of k8s ingresses