mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1823] Feature request: 使用 xtcp 方式时尝试添加 UPnP #1438
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#1438
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 @a180285 on GitHub (May 24, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1823
我的理解,xtcp 在链接时,最重要的一步是 NAT 打洞。
而 UPnP 正好是为这个需求而生的,加之前几年迅雷比较火的,可能部分路由器已经默认打开了 UPnP 功能。就算没默认打开,我猜大部分路由器还是支持 UPnP 的吧。
所以我在想,在 xtcp 的实现中添加 UPnP 的实现,互联之前先通过 UPnP 尝试让路由器主动添加一个UDP 端口映射,应该可以增加 xtcp 的连接成功率。
@fatedier commented on GitHub (May 24, 2020):
@a180285 如果你有兴趣的话,可以先在这个 issue 下写一下简单的过程和逻辑。
或者可以考虑使用其他开源的库来实现。
@a180285 commented on GitHub (May 24, 2020):
我刚刚想用这个 go 包测试,发现没有成功。: https://github.com/huin/goupnp
这里先贴一下效果吧,大概就是像图中一样,图中是我的电信天翼网关管理界面。图中迅雷就使用了 UPnP 从路由器拿到了端口映射。其中 HCDN 好像是爱奇艺的某个服务。
所以我的想法是 frp 也用 UPnP 向路由器申请一些端口映射。
@fatedier commented on GitHub (May 24, 2020):
不是很确定现在家用宽带有多少还有公网 IP 的。
@hdliu61 commented on GitHub (Jan 20, 2021):
@fatedier 还有一个可以提高xtcp成功率的思路:就是 服务提供A 和 服务访问B 通过FRPS互换双方所有网卡所有IP(含IPV6),双方对对方所有IP均进行尝试连接(TCP优先,快速判断,UDP其次),现在家宽和手机热点中IPV6已有较高覆盖率,可以通过IPV6直连接或内网直连,提高xtcp成功率。
@fatedier commented on GitHub (Jan 21, 2021):
@hdliu61 好的,多谢建议,等有时间了在这方面再深入研究下。
@zhc637 commented on GitHub (Sep 20, 2021):
UPNP基本没用了吧,现在家用宽带基本没有公网IP,且运营商为减少维护量都是在光猫中设定PPPOE账号密码,用户直接DHCP获取地址上网了
@a180285 commented on GitHub (Sep 21, 2021):
公网 IP 嘛,有些有,有些没有,也正常。
不过,重新打开这个 issue 话。我现在在想或许 webrtc 也是一种方式。只是不知道能不能实现
@fatedier commented on GitHub (Sep 21, 2021):
@a180285 这个 issue 一直是 open 状态,webrtc 的原理也都是类似的。以后也许会在这方面做更深入的优化。
@shaojs321 commented on GitHub (Aug 12, 2022):
不过如果路由器有了公网ip,那frp作用会大大减小吧,路由器自己做端口转发就行了
@xqzr commented on GitHub (Sep 11, 2022):
即使没有公网 IP,UPnP 一下就有可能获得 Full Cone NAT(NAT1)。
广移 亲测可以获得。
@shaojs321 commented on GitHub (Sep 12, 2022):
有些地方nat类型不一样,广移就是好
@douniwan5788 commented on GitHub (Feb 13, 2023):
可以ipv6直连本身就没必要用frp了吧
@zhaodice commented on GitHub (Feb 15, 2023):
有用的,它可以加密流量,身份认证,端口复用
@junbujianwpl commented on GitHub (Mar 25, 2024):
现在运营商也有得卷吧。
电信就支持公网IP,而且是免费的,应该是全国统一的。缺点是一掉线、重启公网IP就会变,问的师傅说是时间不确定,可能自动清缓存就会导致掉线,师傅帮我查了一下,一个月掉线了2回,还算可以吧。
另外80、443这样一些端口是封禁的。
基本上配合上tplink的DDNS也能用上一波。
还是很期待upnp这样一些打洞功能的
@wuai1024 commented on GitHub (May 28, 2024):
上海移动,upnp 后是 Full Cone NAT(NAT1)
@fatedier commented on GitHub (May 29, 2024):
后续在 https://github.com/fatedier/frp/issues/4112 中跟进。