mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2486] frps是否支持proxy protocol #1974
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#1974
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @luyaotang on GitHub (Jul 18, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2486
为了做高可用的保障,现在的网络结构是某台公网服务器上装了haproxy和frps01,frps02。 客户端先连接到haproxy,然后再分通过本地(127.0.0.1)转frps01,frps02。在这种网络结构下,frps就无法感知客户端真实的ip。希望是haproxy可以启用proxy protocol,然后frps获取到客户端真实ip,是否可行?
@fatedier commented on GitHub (Jul 19, 2021):
之后这个真实 IP 会被用在哪里?frps 拿到了这个 IP 之后具体的作用是什么?
@luyaotang commented on GitHub (Jul 19, 2021):
查看frpc的客户端IP来源,分析定位。某些情况下,还会做IP约束。
@fatedier commented on GitHub (Jul 19, 2021):
目前支持起来比较复杂,之后如果有可能的话会考虑进去。
@MikoyChinese commented on GitHub (Jul 20, 2021):
See detail in https://github.com/fatedier/frp/issues/2470#issuecomment-878131408
@luyaotang commented on GitHub (Jul 20, 2021):
我的跟这些还不一样。我是因为在frps 的监听端口 前置加了haproxy,所以需要frps支持proxy protocol解回来。我的诉求比较简单:我只是需要监听的端口处理能解析proxy protocol,得到原frpc连接时(公网)的IP即可。我已经解决了,有需要的小伙伴可以参考一下:
1)/frp/vendor/github.com/fatedier/golib/net/mux/mux.go