Velocity icon indicating copy to clipboard operation
Velocity copied to clipboard

Add HAProxy PROXY Protocol Forwarding to Backend Servers

Open oneHerobrine opened this issue 11 months ago • 1 comments

Requested Feature

Introduce HAProxy PROXY Protocol forwarding as a new IP forwarding mode in Velocity, enabling it to send PROXY Protocol headers to backend servers (e.g., Paper, Fabric, Forge). This would:

  1. Add a haproxy option to the forwarding-mode configuration.
  2. Allow Velocity to act as a PROXY Protocol sender (client role) when connecting to backend servers.
  3. Ensure backend servers receive standardized client metadata (IP, port) via PROXY headers.

Why is this needed?

Clarification:
Velocity already supports receiving PROXY Protocol from upstream proxies (e.g., HAProxy, Cloudflare), but lacks the ability to forward this metadata to downstream backend servers. This gap causes issues in multi-layer proxy setups.

Alternative Solutions

Attempted Workarounds:

  1. BungeeCord’s PROXY Protocol Support

    • Use BungeeCord instead of Velocity for PROXY forwarding.
    • Downsides: Lacks Velocity’s performance and modern features.
  2. Nginx Middleware

    • Deploy Nginx between Velocity and backend servers to add PROXY headers.
    • Downsides: Adds latency, complicates infrastructure, and duplicates Velocity’s role.
  3. Modify Backend Servers

    • Use plugins like TCPShield on Paper/Fabric to accept Velocity’s legacy mode.
    • Downsides: Introduces version dependency and breaks vanilla compatibility.

Additional Information

No response

oneHerobrine avatar Feb 04 '25 04:02 oneHerobrine

haproxy could never be an alternative to any of the existing player info forwarding options because it doesn't support sending the information required of that mechanism for supported setups, and thus, would not be worth the effort.

I'm also generally not sure what this would actually solve

electronicboy avatar Feb 04 '25 04:02 electronicboy

I'm migrating to Velocity and encountered the same issue.

Brasil150 avatar Oct 07 '25 23:10 Brasil150