Skip to content

server: add proxy protocol support for bind and vhost HTTP/HTTPS listeners#5283

Open
simplysoft wants to merge 2 commits intofatedier:devfrom
simplysoft-net:proxyprotocol
Open

server: add proxy protocol support for bind and vhost HTTP/HTTPS listeners#5283
simplysoft wants to merge 2 commits intofatedier:devfrom
simplysoft-net:proxyprotocol

Conversation

@simplysoft
Copy link
Copy Markdown

Add vhostHTTPSProxyProtocol and vhostHTTPProxyProtocol config options that enable PROXY protocol (v1/v2) parsing on the bind and vhost listeners.

When enabled, the real client IP is extracted from the PROXY protocol header sent by an upstream load balancer and used as the source address for proxied connections. The IP flows through the existing StartWorkConn.SrcAddr mechanism to frpc, making it available in X-Forwarded-For headers (https2http/https2https plugins) and via transport.proxyProtocolVersion for raw TCP proxies.

Uses the existing github.com/pires/go-proxyproto dependency (already used by frpc for sending proxy protocol to local services).

Add vhostHTTPSProxyProtocol and vhostHTTPProxyProtocol config options
that enable PROXY protocol (v1/v2) parsing on the vhost listeners.

When enabled, the real client IP is extracted from the PROXY protocol
header sent by an upstream load balancer and used as the source
address for proxied connections. The IP flows through the existing
StartWorkConn.SrcAddr mechanism to frpc, making it available in
X-Forwarded-For headers (https2http/https2https plugins) and via
transport.proxyProtocolVersion for raw TCP proxies.

Uses the existing github.com/pires/go-proxyproto dependency (already
used by frpc for sending proxy protocol to local services).
Add bindProxyProtocol config option that enables PROXY protocol
(v1/v2) parsing on the main bind port listener. When enabled, the
real client IP is extracted from the PROXY protocol header before
protocol multiplexing, preserving the real client IP in the dashboard
and connection logs.

Uses the existing github.com/pires/go-proxyproto dependency.
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Apr 9, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • pkg/config/v1/server.go
  • server/service.go

Reviewed by gpt-5.4-2026-03-05 · 318,749 tokens

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.

1 participant