Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frps是否支持proxy protocol #2486

Closed
luyaotang opened this issue Jul 18, 2021 · 5 comments
Closed

frps是否支持proxy protocol #2486

luyaotang opened this issue Jul 18, 2021 · 5 comments

Comments

@luyaotang
Copy link

为了做高可用的保障,现在的网络结构是某台公网服务器上装了haproxy和frps01,frps02。 客户端先连接到haproxy,然后再分通过本地(127.0.0.1)转frps01,frps02。在这种网络结构下,frps就无法感知客户端真实的ip。希望是haproxy可以启用proxy protocol,然后frps获取到客户端真实ip,是否可行?

@fatedier
Copy link
Owner

之后这个真实 IP 会被用在哪里?frps 拿到了这个 IP 之后具体的作用是什么?

@luyaotang
Copy link
Author

查看frpc的客户端IP来源,分析定位。某些情况下,还会做IP约束。

@fatedier
Copy link
Owner

目前支持起来比较复杂,之后如果有可能的话会考虑进去。

@MikoyChinese
Copy link

See detail in #2470 (comment)

@luyaotang
Copy link
Author

luyaotang commented Jul 20, 2021

See detail in #2470 (comment)

我的跟这些还不一样。我是因为在frps 的监听端口 前置加了haproxy,所以需要frps支持proxy protocol解回来。我的诉求比较简单:我只是需要监听的端口处理能解析proxy protocol,得到原frpc连接时(公网)的IP即可。我已经解决了,有需要的小伙伴可以参考一下:
1)/frp/vendor/github.com/fatedier/golib/net/mux/mux.go

image

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

No branches or pull requests

3 participants