[GH-ISSUE #4245] XTCP fails on windows #3344

Closed
opened 2026-05-05 14:09:26 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @Jerry12228 on GitHub (May 27, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4245

Bug Description

日志如下(最先是使用quic协议失败, 以下是更改kcp后依然失败)

2024-05-27 10:40:12.583 [I] [sub/root.go:142] start frpc service for config file [.\frpc.json]
2024-05-27 10:40:12.603 [I] [client/service.go:294] try to connect to server...
2024-05-27 10:40:13.362 [I] [client/service.go:286] [06484294096b4d28] login to server success, get run id [06484294096b4d28]
2024-05-27 10:40:13.374 [I] [visitor/visitor_manager.go:121] [06484294096b4d28] start visitor success
2024-05-27 10:40:13.374 [I] [visitor/visitor_manager.go:172] [06484294096b4d28] visitor added: [RDP1S-p2p]
2024-05-27 10:40:14.338 [I] [visitor/xtcp.go:283] [06484294096b4d28] [RDP1S-p2p] nathole prepare success, nat type: EasyNAT, behavior: BehaviorNoChange, addresses: [202.201.94.50:65270 202.201.94.50:65270], assistedAddresses: [192.168.137.1:65270 10.20.3.70:65270]
2024-05-27 10:40:16.446 [I] [visitor/xtcp.go:309] [06484294096b4d28] [RDP1S-p2p] get natHoleRespMsg, sid [1716777614a681494b5c7abe58], protocol [kcp], candidate address [116.176.114.25:5716], assisted address [192.168.31.204:33902 172.17.0.1:33902 172.19.0.1:33902 192.168.49.1:33902 172.18.0.1:33902], detectBehavior: {Role:sender Mode:0 TTL:0 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:0}
2024-05-27 10:40:16.484 [W] [visitor/xtcp.go:316] [06484294096b4d28] [RDP1S-p2p] make hole error: wait detect message error: read udp4 0.0.0.0:65270: wsarecvfrom: The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress.

frpc Version

0.58.0

frps Version

0.58.0

System Architecture

[visitor]windows/amd64, [client]linux/arm64, [server]linux/amd64

Configurations

{
    "serverAddr": "",
    "serverPort": 7000,
    "loginFailExit": false,
    "natHoleStunServer": "stun.easyvoip.com:3478",
    "auth": {
        "method": "token",
        "token": ""
    },

    "log": {
         "to": "log.log"
    },

    "visitors": [
        {
            "name": "RDP1S-p2p",
            "type": "xtcp",
            "serverName": "RDP1S-p2p",
            "secretKey": "",
            "bindADdr": "localhost",
            "bindPort": 13389,

            "keepTunnelOpen": true,
            "protocol": "kcp"
        }
    ]
}

Logs

日志如上文提及

Steps to reproduce

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 @Jerry12228 on GitHub (May 27, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4245 ### Bug Description 日志如下(最先是使用quic协议失败, 以下是更改kcp后依然失败) ``` 2024-05-27 10:40:12.583 [I] [sub/root.go:142] start frpc service for config file [.\frpc.json] 2024-05-27 10:40:12.603 [I] [client/service.go:294] try to connect to server... 2024-05-27 10:40:13.362 [I] [client/service.go:286] [06484294096b4d28] login to server success, get run id [06484294096b4d28] 2024-05-27 10:40:13.374 [I] [visitor/visitor_manager.go:121] [06484294096b4d28] start visitor success 2024-05-27 10:40:13.374 [I] [visitor/visitor_manager.go:172] [06484294096b4d28] visitor added: [RDP1S-p2p] 2024-05-27 10:40:14.338 [I] [visitor/xtcp.go:283] [06484294096b4d28] [RDP1S-p2p] nathole prepare success, nat type: EasyNAT, behavior: BehaviorNoChange, addresses: [202.201.94.50:65270 202.201.94.50:65270], assistedAddresses: [192.168.137.1:65270 10.20.3.70:65270] 2024-05-27 10:40:16.446 [I] [visitor/xtcp.go:309] [06484294096b4d28] [RDP1S-p2p] get natHoleRespMsg, sid [1716777614a681494b5c7abe58], protocol [kcp], candidate address [116.176.114.25:5716], assisted address [192.168.31.204:33902 172.17.0.1:33902 172.19.0.1:33902 192.168.49.1:33902 172.18.0.1:33902], detectBehavior: {Role:sender Mode:0 TTL:0 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:0} 2024-05-27 10:40:16.484 [W] [visitor/xtcp.go:316] [06484294096b4d28] [RDP1S-p2p] make hole error: wait detect message error: read udp4 0.0.0.0:65270: wsarecvfrom: The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. ``` ### frpc Version 0.58.0 ### frps Version 0.58.0 ### System Architecture [visitor]windows/amd64, [client]linux/arm64, [server]linux/amd64 ### Configurations ``` { "serverAddr": "", "serverPort": 7000, "loginFailExit": false, "natHoleStunServer": "stun.easyvoip.com:3478", "auth": { "method": "token", "token": "" }, "log": { "to": "log.log" }, "visitors": [ { "name": "RDP1S-p2p", "type": "xtcp", "serverName": "RDP1S-p2p", "secretKey": "", "bindADdr": "localhost", "bindPort": 13389, "keepTunnelOpen": true, "protocol": "kcp" } ] } ``` ### Logs 日志如上文提及 ### Steps to reproduce _No response_ ### Affected area - [ ] Docs - [ ] Installation - [X] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 14:09:26 -06:00
Author
Owner

@xqzr commented on GitHub (May 28, 2024):

多连几次
https://github.com/fatedier/frp/issues/4232#issuecomment-2123779640

如果打洞失败,可以尝试多次建立连接,程序会尝试其他的打洞策略,有可能在多次重试后成功打洞。

https://gofrp.org/zh-cn/docs/features/xtcp/

<!-- gh-comment-id:2134738535 --> @xqzr commented on GitHub (May 28, 2024): 多连几次 https://github.com/fatedier/frp/issues/4232#issuecomment-2123779640 > 如果打洞失败,可以尝试多次建立连接,程序会尝试其他的打洞策略,有可能在多次重试后成功打洞。 https://gofrp.org/zh-cn/docs/features/xtcp/
Author
Owner

@fatedier commented on GitHub (May 29, 2024):

看上去像是 windows 环境下的特殊问题,quic-go repo 下有一个相关的 issue https://github.com/quic-go/quic-go/issues/1737

我缺乏复现环境,不是很好测试。

<!-- gh-comment-id:2136450225 --> @fatedier commented on GitHub (May 29, 2024): 看上去像是 windows 环境下的特殊问题,quic-go repo 下有一个相关的 issue https://github.com/quic-go/quic-go/issues/1737 我缺乏复现环境,不是很好测试。
Author
Owner

@Jerry12228 commented on GitHub (May 29, 2024):

看上去像是 windows 环境下的特殊问题,quic-go repo 下有一个相关的 issue quic-go/quic-go#1737

我缺乏复现环境,不是很好测试。

Windows 所处网络环境是校园网

我应该如何测试(由于使用的是学校的多媒体所以时间不是很充分, 我能做到的大概就是拿编译好的exe运行以下然后收集日志)?

quic失败日志:

024-05-24 20:09:58.874 [I] [sub/root.go:142] start frpc service for config file [.\frpc.json]
2024-05-24 20:09:58.891 [I] [client/service.go:294] try to connect to server...
2024-05-24 20:10:00.606 [I] [client/service.go:286] [e597d4a1d7bbeea2] login to server success, get run id [e597d4a1d7bbeea2]
2024-05-24 20:10:00.619 [I] [visitor/visitor_manager.go:121] [e597d4a1d7bbeea2] start visitor success
2024-05-24 20:10:00.619 [I] [visitor/visitor_manager.go:172] [e597d4a1d7bbeea2] visitor added: [RDP1S-p2p]
2024-05-24 20:10:32.511 [I] [visitor/xtcp.go:283] [e597d4a1d7bbeea2] [RDP1S-p2p] nathole prepare success, nat type: EasyNAT, behavior: BehaviorNoChange, addresses: [202.201.94.50:58952 202.201.94.50:58952], assistedAddresses: [192.168.137.1:58952 10.20.3.70:58952]
2024-05-24 20:10:34.845 [I] [visitor/xtcp.go:309] [e597d4a1d7bbeea2] [RDP1S-p2p] get natHoleRespMsg, sid [17165526321c552c2bbee79327], protocol [quic], candidate address [116.176.114.25:5519], assisted address [192.168.31.204:53364 172.17.0.1:53364 172.19.0.1:53364 192.168.49.1:53364 172.18.0.1:53364], detectBehavior: {Role:sender Mode:0 TTL:0 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:0}
2024-05-24 20:10:34.861 [W] [visitor/xtcp.go:316] [e597d4a1d7bbeea2] [RDP1S-p2p] make hole error: wait detect message error: read udp4 0.0.0.0:58952: wsarecvfrom: The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress.
<!-- gh-comment-id:2136522092 --> @Jerry12228 commented on GitHub (May 29, 2024): > 看上去像是 windows 环境下的特殊问题,quic-go repo 下有一个相关的 issue [quic-go/quic-go#1737](https://github.com/quic-go/quic-go/issues/1737) > > 我缺乏复现环境,不是很好测试。 Windows 所处网络环境是校园网 我应该如何测试(由于使用的是学校的多媒体所以时间不是很充分, 我能做到的大概就是拿编译好的exe运行以下然后收集日志)? quic失败日志: ``` 024-05-24 20:09:58.874 [I] [sub/root.go:142] start frpc service for config file [.\frpc.json] 2024-05-24 20:09:58.891 [I] [client/service.go:294] try to connect to server... 2024-05-24 20:10:00.606 [I] [client/service.go:286] [e597d4a1d7bbeea2] login to server success, get run id [e597d4a1d7bbeea2] 2024-05-24 20:10:00.619 [I] [visitor/visitor_manager.go:121] [e597d4a1d7bbeea2] start visitor success 2024-05-24 20:10:00.619 [I] [visitor/visitor_manager.go:172] [e597d4a1d7bbeea2] visitor added: [RDP1S-p2p] 2024-05-24 20:10:32.511 [I] [visitor/xtcp.go:283] [e597d4a1d7bbeea2] [RDP1S-p2p] nathole prepare success, nat type: EasyNAT, behavior: BehaviorNoChange, addresses: [202.201.94.50:58952 202.201.94.50:58952], assistedAddresses: [192.168.137.1:58952 10.20.3.70:58952] 2024-05-24 20:10:34.845 [I] [visitor/xtcp.go:309] [e597d4a1d7bbeea2] [RDP1S-p2p] get natHoleRespMsg, sid [17165526321c552c2bbee79327], protocol [quic], candidate address [116.176.114.25:5519], assisted address [192.168.31.204:53364 172.17.0.1:53364 172.19.0.1:53364 192.168.49.1:53364 172.18.0.1:53364], detectBehavior: {Role:sender Mode:0 TTL:0 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:0} 2024-05-24 20:10:34.861 [W] [visitor/xtcp.go:316] [e597d4a1d7bbeea2] [RDP1S-p2p] make hole error: wait detect message error: read udp4 0.0.0.0:58952: wsarecvfrom: The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. ```
Author
Owner

@coreshowfun commented on GitHub (Jun 7, 2024):

建议检测NAT类型,如果是对称型NAT,打洞成功率极低极低,端口要随机匹配上

<!-- gh-comment-id:2153809192 --> @coreshowfun commented on GitHub (Jun 7, 2024): 建议检测NAT类型,如果是对称型NAT,打洞成功率极低极低,端口要随机匹配上
Author
Owner

@github-actions[bot] commented on GitHub (May 22, 2025):

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

<!-- gh-comment-id:2899586159 --> @github-actions[bot] commented on GitHub (May 22, 2025): Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d 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#3344
No description provided.