[GH-ISSUE #1410] proxy protocol v1 的 TCP4 变成了 TCP6,导致 Postfix 无法识别 #1113

Closed
opened 2026-05-05 12:42:58 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @ghost on GitHub (Aug 25, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1410

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)
(请不要在 issue 评论中出现无意义的 加1我也是 等内容,将会被直接删除。)
(由于个人精力有限,和系统环境,网络环境等相关的求助问题请转至其他论坛或社交平台。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
0.28.2

What operating system and processor architecture are you using (go env)?
客户端: armv7l
服务器: x86_64

Configures you used:
客户端

[common]
server_addr = 1.2.3.4
server_port = 12345

[postfix]
type = tcp
local_ip = 127.0.0.1
local_port = 25
remote_port = 25
proxy_protocol_version = v1

服务器

[common]
bind_port = 12345

Postfix(/etc/postfix/main.cf
(enable PROXY Protocol Only)

smtpd_upstream_proxy_protocol = haproxy

Steps to reproduce the issue:

  1. 启动 frpc、frps 以及 Postfix;
  2. 使用 IPv4 连接 1.2.3.4:25(假设源 IP 为 5.6.7.8);
  3. Postfix 报告 PROXY Protocol 出错。

Describe the results you received:
Postfix 报错:

warning: haproxy read: unexpected client address syntax: PROXY TCP6 5.6.7.8 1.2.3.4 12345 25

然后连接关闭。
很明显,这里的 PROXY 指令不应该使用 TCP6,而是应该使用 TCP4。

Describe the results you expected:
使用 IPv4 连接时,PROXY Protocol 能够发出正确的指令。
比如上面的指令应该是:

PROXY TCP4 5.6.7.8 1.2.3.4 12345 25

Additional information you deem important (e.g. issue happens only occasionally):
N/A

Can you point out what caused this issue (optional)
PROXY Protocol 指令错误。

Originally created by @ghost on GitHub (Aug 25, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1410 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) (请不要在 issue 评论中出现无意义的 **加1**,**我也是** 等内容,将会被直接删除。) (由于个人精力有限,和系统环境,网络环境等相关的求助问题请转至其他论坛或社交平台。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** 0.28.2 **What operating system and processor architecture are you using (`go env`)?** 客户端: armv7l 服务器: x86_64 **Configures you used:** 客户端 ``` [common] server_addr = 1.2.3.4 server_port = 12345 [postfix] type = tcp local_ip = 127.0.0.1 local_port = 25 remote_port = 25 proxy_protocol_version = v1 ``` 服务器 ``` [common] bind_port = 12345 ``` Postfix(`/etc/postfix/main.cf `) (enable PROXY Protocol Only) ``` smtpd_upstream_proxy_protocol = haproxy ``` **Steps to reproduce the issue:** 1. 启动 frpc、frps 以及 Postfix; 2. 使用 IPv4 连接 1.2.3.4:25(假设源 IP 为 5.6.7.8); 3. Postfix 报告 PROXY Protocol 出错。 **Describe the results you received:** Postfix 报错: ``` warning: haproxy read: unexpected client address syntax: PROXY TCP6 5.6.7.8 1.2.3.4 12345 25 ``` 然后连接关闭。 很明显,这里的 PROXY 指令不应该使用 TCP6,而是应该使用 TCP4。 **Describe the results you expected:** 使用 IPv4 连接时,PROXY Protocol 能够发出正确的指令。 比如上面的指令应该是: ``` PROXY TCP4 5.6.7.8 1.2.3.4 12345 25 ``` **Additional information you deem important (e.g. issue happens only occasionally):** N/A **Can you point out what caused this issue (optional)** PROXY Protocol 指令错误。
gitea-mirror 2026-05-05 12:42:58 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@fatedier commented on GitHub (Aug 26, 2019):

判断是 v4 还是 v6 的逻辑有问题,需要 fix。

<!-- gh-comment-id:524698478 --> @fatedier commented on GitHub (Aug 26, 2019): 判断是 v4 还是 v6 的逻辑有问题,需要 fix。
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#1113
No description provided.