← Back to Forum
1
Proxy
LocaltoNet TCP tunnel with PROXY protocol for real client IP
I'm exposing a local game server over a raw TCP tunnel, and right now the app only sees the tunnel connection IP. I'm not talking about HTTP headers here, I need to know whether LocaltoNet can prepend PROXY protocol v1 or v2 on inbound TCP connections so the server can recover the actual client address.
If LocaltoNet doesn't do that, what's the usual setup people use in front of a local TCP service to keep the real client IP available without confusing a custom socket protocol or game server handshake? I'm trying to avoid bolting on something fragile if there's already a standard path for this.
Comments (3)
If the service can't speak PROXY itself, sticking a shim in front of it tends to get ugly fast. I went down that road with a custom TCP thing years back, ended up easier to use a small relay I controlled and log the source there rather than teaching an old protocol new tricks.
Yeah, that's exactly the failure mode I'm trying to avoid, a byte-injecting shim in front of a game protocol feels like a good way to break login or version negotiation. I can live with a relay I control if that's the only sane path, but before I build that out, have you seen anything from LocaltoNet specifically about PROXY v1/v2 on raw TCP, or did you rule it out and move straight to your own relay?
Hi,
To get the real client IP, you just need to enable the "Proxy Protocol?" checkbox in your tunnel settings. You can toggle this on when creating a new tunnel or editing an existing one.
Once enabled, make sure your backend server (nginx, HAProxy, your app, etc.) also supports and accepts PROXY protocol v1, otherwise you may run into connection errors. For example, if you're using nginx, you'll need to add the proxy_protocol parameter to your listen directive.
Please log in to post a comment.