Proxy Protocol
Gate supports the HAProxy PROXY protocol, which preserves the original client IP address when Gate is deployed behind load balancers, reverse proxies, or DDoS protection services.What is PROXY Protocol?
The PROXY protocol is a network protocol designed to pass connection information (primarily the client’s IP address) through proxies and load balancers:- Developed by HAProxy
- Industry-standard for preserving client information
- Supports both TCP (v1) and binary (v2) formats
- Works with load balancers, reverse proxies, and DDoS mitigation services
Without PROXY protocol, Gate would only see the load balancer’s IP address, not the actual player’s IP.
Why Use PROXY Protocol?
Problem: IP Address Masking
When Gate sits behind a load balancer:- Gate sees all connections from
10.0.0.1(load balancer IP) - Rate limiting breaks (all players share same IP)
- IP bans don’t work properly
- Geolocation services fail
- Logs show wrong IP addresses
- Gate receives the real player IP
203.0.113.50 - Rate limiting works correctly per player
- IP bans function properly
- Accurate geolocation and logging
Configuration
Client-Side: Receiving PROXY Protocol
Configure Gate to receive PROXY protocol headers from upstream load balancers:Backend-Side: Sending PROXY Protocol
Gate can also send PROXY protocol headers to backend servers:This is useful when backend servers are behind their own load balancers or need the original client IP.
Common Deployment Scenarios
Scenario 1: Gate Behind Load Balancer
Architecture:- Enable PROXY protocol output
config.yml):
- Configure Velocity forwarding (no PROXY protocol needed)
Scenario 2: DDoS Protection Service
Architecture:- Enable PROXY protocol in service settings
config.yml):
Many DDoS protection services (TCPShield, Cloudflare Spectrum, etc.) use PROXY protocol to preserve client IPs.
Scenario 3: Multi-Layer Proxy
Architecture:config.yml):
- Enable PROXY protocol receive
- Forward to game servers using appropriate method
Scenario 4: Kubernetes/Docker
Architecture:config.yml):
Gate Lite Mode
Gate Lite supports per-route PROXY protocol configuration:This allows you to have some backends that support PROXY protocol and others that don’t.
Load Balancer Configuration
HAProxy
HAProxy configuration:NGINX
NGINX TCP load balancing with PROXY protocol:AWS Network Load Balancer
Enable PROXY protocol v2:- Create target group for Gate instances
- Edit target group attributes:
- Enable “Proxy protocol v2”
- Attach target group to load balancer
AWS NLB supports PROXY protocol v2. Application Load Balancers (ALB) do not support TCP passthrough.
Google Cloud Load Balancer
TCP Proxy Load Balancer with PROXY protocol:DDoS Protection Services
TCPShield
TCPShield automatically uses PROXY protocol: Gate configuration:TCPShield’s RealIP protocol is proprietary but supported in Gate Lite mode.
Cloudflare Spectrum
Cloudflare Spectrum supports PROXY protocol:- Enable “Proxy Protocol” in Spectrum settings
- Configure Gate to receive PROXY protocol
OVH Game DDoS Protection
OVH supports PROXY protocol v2:- Enable in OVH control panel
- Configure Gate accordingly
Security Considerations
PROXY Protocol Spoofing
If enabled without a trusted upstream proxy:- Attackers can send fake PROXY protocol headers
- Spoof any IP address
- Bypass IP bans and rate limiting
- Forge connection source information
Firewall Protection
Always protect Gate with firewall rules:Firewall rules ensure only your trusted load balancer can connect, preventing PROXY protocol spoofing attacks.
Docker/Kubernetes Network Policies
Kubernetes NetworkPolicy:Troubleshooting
All Connections Fail After Enabling
Symptoms: No players can connect, timeout errors Cause:proxyProtocol: true but load balancer not sending PROXY headers
Solutions:
- Verify load balancer is sending PROXY protocol
- Check load balancer configuration
- Disable if not behind a proxy:
All Players Show Same IP
Symptoms: All players have load balancer’s IP address Cause: PROXY protocol not enabled Solutions:- Enable PROXY protocol on load balancer
- Enable in Gate:
- Verify firewall allows load balancer connections
Rate Limiting Not Working
Symptoms: Rate limiting applies to all players collectively Cause: All players share load balancer’s IP Solution: Enable PROXY protocol to see real IPs:Invalid PROXY Protocol Header
Symptoms: Connection errors, “invalid PROXY protocol header” Causes:- Load balancer sending wrong PROXY protocol version
- Firewall or middleware stripping headers
- Direct player connections (when expecting PROXY protocol)
- Verify PROXY protocol version matches (v1 or v2)
- Check no middleware is interfering
- Ensure only load balancer can connect (firewall)
Testing PROXY Protocol
Manual Test
You can manually test PROXY protocol with telnet: PROXY protocol v1:Validation
Verify Gate sees correct IPs:-
Enable debug logging:
- Connect as player
-
Check Gate logs for player’s real IP:
- Verify rate limiting works per-player
Best Practices
Production Deployment
Recommended configuration for production behind load balancer:
Development/Testing
Direct connection (no load balancer):Related Topics
- Forwarding Modes - Forward player info to backends
- DDoS Protection - Protect against attacks
- Gate Lite Mode - Lightweight reverse proxy with per-route PROXY protocol
- Rate Limiting - Configure quota settings

