Skip to content

feat: add HAProxy PROXY protocol support#1381

Closed
majiayu000 wants to merge 2 commits intoTecharoHQ:mainfrom
majiayu000:fix-1208-feature-request-proxy-protocol-0102-0904
Closed

feat: add HAProxy PROXY protocol support#1381
majiayu000 wants to merge 2 commits intoTecharoHQ:mainfrom
majiayu000:fix-1208-feature-request-proxy-protocol-0102-0904

Conversation

@majiayu000
Copy link
Copy Markdown
Contributor

Fixes #1208

Changes

  • Add support for HAProxy PROXY protocol (v1 and v2) to preserve client IP from upstream load balancers
  • Add --proxy-protocol flag to enable PROXY protocol parsing
  • Add --proxy-protocol-timeout flag for configurable header read timeout (default 5s)
  • Extract client IP from PROXY protocol header and set X-Real-IP for downstream processing
  • Support both IPv4 and IPv6 addresses

Implement PROXY protocol v1/v2 support to preserve client IP from upstream
load balancers like HAProxy, AWS ELB, and others.

New CLI flags:
- --proxy-protocol: enables PROXY protocol parsing on incoming connections
- --proxy-protocol-timeout: configures header read timeout (default 5s)

When enabled, the real client IP is extracted from the PROXY protocol header
and set as X-Real-IP for use by the rest of the middleware chain.

Closes TecharoHQ#1208

Signed-off-by: majiayu000 <1835304752@qq.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
@joshua-siw joshua-siw mentioned this pull request Jan 2, 2026
4 tasks
@majiayu000
Copy link
Copy Markdown
Contributor Author

Closing this PR due to extended inactivity. Happy to reopen if there's still interest — feel free to comment.

@majiayu000 majiayu000 closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] PROXY protocol support

1 participant