valkey-io / valkey

A flexible distributed key-value datastore that supports both caching and beyond caching workloads.
https://valkey.io
Other
15.57k stars 576 forks source link

[NEW] Support proxy protocol #882

Open kamyuentse opened 1 month ago

kamyuentse commented 1 month ago

The problem/use-case that the feature addresses

For the cache server deployed behind L4 gateway(LB, PrivateLink, etc.),the peer address not the real client address. This makes things complicated in troubleshooting.

Description of the feature

Support proxy protocol, which allow proxy pass the real client address to the backend.

Alternatives you've considered

Currently, we have capability to set the "client name", but in most cases, the user not send this information, or they not have a unique value.

Additional information

https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

https://learn.microsoft.com/en-us/azure/private-link/private-link-service-overview#getting-connection-information-using-tcp-proxy-v2

https://aws.amazon.com/cn/blogs/networking-and-content-delivery/preserving-client-ip-address-with-proxy-protocol-v2-and-network-load-balancer/

hpatro commented 1 month ago

I think in general this will be helpful for proxies but never saw this request. Thanks for the issue @kamyuentse.

Is this proxy protocol specific to HAProxy or is it a standard?

kamyuentse commented 1 month ago

I think in general this will be helpful for proxies but never saw this request. Thanks for the issue @kamyuentse.

Is this proxy protocol specific to HAProxy or is it a standard?

This protocol was originally designed by Willy Tarreau and use in haproxy proxy-protocol

Currently, it widely use in many open source projects and cloud service, like nginx, haproxy, AWS PrivateLink, NLB, Azure PrivateLink.

It seems not a standard, I cann't found a publication in IETF database or other standard organization. But I think proxy protocol already a de facto standard.

References