jaracil / nexus

Distributed RPC system
Other
11 stars 2 forks source link

Obtain real IP address of clients behind loadbalanced/reverseproxied connections #23

Closed pho closed 8 years ago

pho commented 8 years ago

Nexus daemons listening behind a TCP reverse proxy or load balancer wont get the real client source IP address.

Nginx and HAProxy workaround this by implementing the PROXY Protocol, which prepends a payload of the real client data before the raw tcp conversation.

We cannot try to read the first line of the TCP stream and check whether it contains PROXY protocol or not, because a non-trusted client could forge a proxy header and try to bypass an IP white/blacklist. Instead we should setup specific listeners for this proxyed connections and make sure that only a trusted balancer can reach the address

pho commented 8 years ago

Implemented on 12639d19a6ec