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

Open
opened 2026-05-05 14:57:04 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/5283
Author: @simplysoft
Created: 4/9/2026
Status: 🔄 Open

Base: devHead: proxyprotocol


📝 Commits (2)

  • 11ac3e0 server: add proxy protocol support for vhost HTTP/HTTPS listeners
  • 0d05e6d server: add proxy protocol support for bind port listener

📊 Changes

2 files changed (+28 additions, -0 deletions)

View changed files

📝 pkg/config/v1/server.go (+14 -0)
📝 server/service.go (+14 -0)

📄 Description

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).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/5283 **Author:** [@simplysoft](https://github.com/simplysoft) **Created:** 4/9/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `proxyprotocol` --- ### 📝 Commits (2) - [`11ac3e0`](https://github.com/fatedier/frp/commit/11ac3e031f2c56c756514ddc2597c27b02220eb4) server: add proxy protocol support for vhost HTTP/HTTPS listeners - [`0d05e6d`](https://github.com/fatedier/frp/commit/0d05e6d55e3f616506e569fbed42dc6ba3f6c96f) server: add proxy protocol support for bind port listener ### 📊 Changes **2 files changed** (+28 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `pkg/config/v1/server.go` (+14 -0) 📝 `server/service.go` (+14 -0) </details> ### 📄 Description 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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror added the
pull-request
label 2026-05-05 14:57:04 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#5226
No description provided.