mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1673] 获取到访客的真实IP全部带有::ffff:前缀 #1325
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#1325
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 @ProjectSky on GitHub (Feb 22, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1673
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)?
What operating system and processor architecture are you using (
go env)?Configures you used:
使用proxy_protocol功能尝试获取真实IP,设置完成之后,站点访问正常,但是nginx日志中的访问IP全部带有::ffff:前缀,因为需要判断IP,出现::ffff:字段会导致异常,请问这是什么问题?
@fatedier commented on GitHub (Feb 22, 2020):
这个是有效的 IPv6 地址格式,可以被正常解析的。
@ProjectSky commented on GitHub (Feb 22, 2020):
这是IPv4 映射之后的 IPv6地址,我只需要去除::ffff:
@fatedier commented on GitHub (Feb 22, 2020):
可能是你的服务器支持了 IPv6 ,所以解析出来的地址是这个,解析的代码里还是都兼容下比较好,测试 golang 的 IP 解析函数是支持的。
@ProjectSky commented on GitHub (Feb 22, 2020):
测试了一下,换一台服务器不论开启还是关闭IPV6都不会出现::ffff:,但是换回去又出现了,感觉是服务端的问题,因为其中一台主机我无权访问,不能修改任何东西,只能连接,感觉是服务端的frps版本太旧了。
因为我记得之前也遇到过::ffff:,后来突然正常了,可能是某次更新牵扯到了这个问题。
@fatedier commented on GitHub (Feb 23, 2020):
也不一定是和 frps 的版本有关系,可能是和 frps 所在机器的网络配置有关系。
@ProjectSky commented on GitHub (Feb 23, 2020):
嗯,没找出具体原因,目前暂时连接另一台的服务器。
先关闭issue吧。
@cnyasin commented on GitHub (Mar 14, 2020):
能否贴一下较完整NGINX配置?参考一下?
@ProjectSky commented on GitHub (Mar 20, 2020):
配置已经贴在上面了,开启proxy_protocol就行了。
@cnyasin commented on GitHub (Mar 20, 2020):
Sky notifications@github.com于2020年3月20日 周五13:30写道:
嗯!已经结合另一篇issue解决了!谢谢!