[GH-ISSUE #2977] [Feature Request] XTCP Client使用固定端口号 #2378

Closed
opened 2026-05-05 13:31:49 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @scp-r on GitHub (Jun 13, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2977

Describe the feature request

网络

  • 主机A具有IPv6地址,使用蜂窝网络
  • 主机B在OpenWRT路由器的网络内,家宽,也具有IPv6地址(通过SLAAC自动配置)
  • OpenWRT默认情况下丢弃所有入站IPv6数据包,只允许出站,但是可以通过配置防火墙规则允许指定主机上全部或者部分端口的通信。具体配置方法见https://rongrongbq.moe/2021/08/firewall-and-DDNS-settings-for-IPv6/
  • FRP Server在主机C上,也具有公网IPv6地址

使用场景

我的使用场景是希望通过FRP的XTCP连接,实现从主机A访问到主机B(完全通过IPv6),但是通过具体测试来看似乎每次主机B提供的连接端口都是一个随机端口,这样就不得不在OpenWRT中配置打开该主机的全部端口。希望能通过提供配置项的形式来指定主机B在指定端口上接受xtcp的p2p连接。

其他

  • 目前FRP在处理IPv6地址上似乎存在问题,我在本地编译时修改了两处ResolveUDPAddr的调用,能够实现在开放全部端口的情况下正常使用xtcp。这两处包括:client/visitor.go的第215行、client/proxy.go的第310行。如果将这两处构造地址的表达式从%s:%d改成[%s]:%d即可正常处理IPv6地址(但是这样就不能处理IPv4地址,具体解决方法肯定不是这样直接修改的)

  • 为什么不使用DDNS:在家宽网络上使用DDNS可能会带来一些麻烦,可参考https://www.v2ex.com/t/799340

  • 为什么不干脆开放全部端口:主要是考虑到安全因素

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @scp-r on GitHub (Jun 13, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/2977 ### Describe the feature request #### 网络 * 主机A具有IPv6地址,使用蜂窝网络 * 主机B在OpenWRT路由器的网络内,家宽,也具有IPv6地址(通过SLAAC自动配置) * OpenWRT默认情况下丢弃所有入站IPv6数据包,只允许出站,但是可以通过配置防火墙规则允许指定主机上全部或者部分端口的通信。具体配置方法见<https://rongrongbq.moe/2021/08/firewall-and-DDNS-settings-for-IPv6/> * FRP Server在主机C上,也具有公网IPv6地址 #### 使用场景 我的使用场景是希望通过FRP的XTCP连接,实现从主机A访问到主机B(完全通过IPv6),但是通过具体测试来看似乎每次主机B提供的连接端口都是一个随机端口,这样就不得不在OpenWRT中配置打开该主机的全部端口。希望能通过提供配置项的形式来指定主机B在指定端口上接受xtcp的p2p连接。 #### 其他 * 目前FRP在处理IPv6地址上似乎存在问题,我在本地编译时修改了两处ResolveUDPAddr的调用,能够实现在开放全部端口的情况下正常使用xtcp。这两处包括:`client/visitor.go`的第215行、`client/proxy.go`的第310行。如果将这两处构造地址的表达式从`%s:%d`改成`[%s]:%d`即可正常处理IPv6地址(但是这样就不能处理IPv4地址,具体解决方法肯定不是这样直接修改的) * 为什么不使用DDNS:在家宽网络上使用DDNS可能会带来一些麻烦,可参考<https://www.v2ex.com/t/799340> * 为什么不干脆开放全部端口:主要是考虑到安全因素 ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:31:49 -06:00
Author
Owner

@fatedier commented on GitHub (Jun 13, 2022):

  • ipv6 的问题应该是 bug,应该是可以修复的。
  • xtcp 暂时不会做出功能上的调整了,这部分的实现不是很好,以后有可能话再去考虑重新优化。
<!-- gh-comment-id:1153674752 --> @fatedier commented on GitHub (Jun 13, 2022): * ipv6 的问题应该是 bug,应该是可以修复的。 * xtcp 暂时不会做出功能上的调整了,这部分的实现不是很好,以后有可能话再去考虑重新优化。
Author
Owner

@github-actions[bot] commented on GitHub (Jul 14, 2022):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1183815999 --> @github-actions[bot] commented on GitHub (Jul 14, 2022): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
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#2378
No description provided.