[GH-ISSUE #2235] 某些客户端通过frp远程连接服务器后30s掉线的问题 #1778

Closed
opened 2026-05-05 13:08:55 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @shminer on GitHub (Feb 5, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2235

[REQUIRED] hat version of frp are you using

Version: 0.35.1

[REQUIRED] What operating system and processor architecture are you using
OS: server is windows server 2019 and client is windows 7
CPU architecture: amd64

[REQUIRED] description of errors

  • frp基本环境说明:服务器a使用frpc进行穿透,通过外网登录到服务器b。之后将自己130端口映射到服务器b上。
  • 内网状态说明:内网状态下客户端a通过服务器130端口登录到服务器a进行通信,之后服务器a可以看到客户端a,同时可以使用130端口对其服务进行操作,通过netstat查看双方只建立1个连接。暂时不太清楚服务器a是如何获得客户端a在线状态的。
  • 问题说明:客户端a通过服务器b访问服务器a,刚开始时一切正常,经过30s(多次测试),frps和frpc同时显示 join connections closed,服务器a的frpc直接释放了端口,客户端a通过netstat显示close_wait, 服务器b显示
    FIN_WAIT_2。

confile

log file

Steps to reproduce the issue
1.
2.
3.

Supplementary information

  • 服务器b仍然使用frps代理其他tcp服务,其他服务均正常。另外客户端a和服务端a的软件是第三方开发的,有些东西无法了解。
    Can you guess what caused this issue
  • 经测试客户端和服务端在内网状态下都正常,只有经过frp才会30s断线,30s正好是一个报文的寿命,但是目前仍然不知道为什么在内网下就没事。
    Checklist:
  • I included all information required in the sections above
  • I made sure there are no duplicates of this report (Use Search)
Originally created by @shminer on GitHub (Feb 5, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2235 <!-- From Chinese to English by machine translation, welcome to revise and polish. --> <!-- ⚠️⚠️ Incomplete reports will be marked as invalid, and closed, with few exceptions ⚠️⚠️ --> <!-- in addition, please use search well so that the same solution can be found in the feedback, we will close it directly --> <!-- for convenience of differentiation, use FRPS or FRPC to refer to the FRP server or client --> **[REQUIRED] hat version of frp are you using** <!-- Use ./frpc -v or ./frps -v --> Version: 0.35.1 **[REQUIRED] What operating system and processor architecture are you using** OS: server is windows server 2019 and client is windows 7 CPU architecture: amd64 **[REQUIRED] description of errors** * frp基本环境说明:服务器a使用frpc进行穿透,通过外网登录到服务器b。之后将自己130端口映射到服务器b上。 * 内网状态说明:内网状态下客户端a通过服务器130端口登录到服务器a进行通信,之后服务器a可以看到客户端a,同时可以使用130端口对其服务进行操作,通过netstat查看双方只建立1个连接。暂时不太清楚服务器a是如何获得客户端a在线状态的。 * 问题说明:客户端a通过服务器b访问服务器a,刚开始时一切正常,经过30s(多次测试),frps和frpc同时显示 join connections closed,服务器a的frpc直接释放了端口,客户端a通过netstat显示close_wait, 服务器b显示 FIN_WAIT_2。 **confile** <!-- Please pay attention to hiding the token, server_addr and other privacy information --> **log file** <!-- If the file is too large, use Pastebin, for example https://pastebin.ubuntu.com/ --> **Steps to reproduce the issue** 1. 2. 3. **Supplementary information** * 服务器b仍然使用frps代理其他tcp服务,其他服务均正常。另外客户端a和服务端a的软件是第三方开发的,有些东西无法了解。 **Can you guess what caused this issue** * 经测试客户端和服务端在内网状态下都正常,只有经过frp才会30s断线,30s正好是一个报文的寿命,但是目前仍然不知道为什么在内网下就没事。 **Checklist**: <!--- Make sure you've completed the following steps (put an "X" between of brackets): --> - [X] I included all information required in the sections above - [X] I made sure there are no duplicates of this report [(Use Search)](https://github.com/fatedier/frp/issues?q=is%3Aissue)
gitea-mirror 2026-05-05 13:08:55 -06:00
Author
Owner

@zsinba commented on GitHub (Feb 5, 2021):

是不是你使用的移动的网络,他是共享外网ip,造成了你的对外ip一直在变化 .

电信的adsl试试尼.

<!-- gh-comment-id:773839393 --> @zsinba commented on GitHub (Feb 5, 2021): 是不是你使用的移动的网络,他是共享外网ip,造成了你的对外ip一直在变化 . 电信的adsl试试尼.
Author
Owner

@shminer commented on GitHub (Feb 5, 2021):

是不是你使用的移动的网络,他是共享外网ip,造成了你的对外ip一直在变化 .

电信的adsl试试尼.

双方都是固定IP,看了源码应该是作者30s中断一次链接防止长连接。

<!-- gh-comment-id:773882286 --> @shminer commented on GitHub (Feb 5, 2021): > 是不是你使用的移动的网络,他是共享外网ip,造成了你的对外ip一直在变化 . > > 电信的adsl试试尼. 双方都是固定IP,看了源码应该是作者30s中断一次链接防止长连接。
Author
Owner

@github-actions[bot] commented on GitHub (Mar 23, 2021):

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

<!-- gh-comment-id:804512743 --> @github-actions[bot] commented on GitHub (Mar 23, 2021): Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.
Author
Owner

@HellowBoy commented on GitHub (Feb 7, 2025):

我是这样解决的,目前测试没问题了。
1、客户端和服务器端关闭端口复用,下面只给出了服务端的配置,客户端也有相应的设置
transport.tcpMux = false
transport.tcpMuxKeepaliveInterval = 60

transport.heartbeatTimeout = 60

2、部分客户端插件注册间隔时间设置为0。如openwrt中

大家可以试试,有用点赞呢

<!-- gh-comment-id:2641985789 --> @HellowBoy commented on GitHub (Feb 7, 2025): 我是这样解决的,目前测试没问题了。 1、客户端和服务器端关闭端口复用,下面只给出了服务端的配置,客户端也有相应的设置 transport.tcpMux = false transport.tcpMuxKeepaliveInterval = 60 transport.heartbeatTimeout = 60 2、部分客户端插件注册间隔时间设置为0。如openwrt中 大家可以试试,有用点赞呢
Author
Owner

@dream-one commented on GitHub (Feb 19, 2025):

我是这样解决的,目前测试没问题了。 1、客户端和服务器端关闭端口复用,下面只给出了服务端的配置,客户端也有相应的设置 transport.tcpMux = false transport.tcpMuxKeepaliveInterval = 60

transport.heartbeatTimeout = 60

2、部分客户端插件注册间隔时间设置为0。如openwrt中

大家可以试试,有用点赞呢

加上第一点配置之后可以多连接几秒,但是还是会断线,第二点怎么设置?

<!-- gh-comment-id:2667602523 --> @dream-one commented on GitHub (Feb 19, 2025): > 我是这样解决的,目前测试没问题了。 1、客户端和服务器端关闭端口复用,下面只给出了服务端的配置,客户端也有相应的设置 transport.tcpMux = false transport.tcpMuxKeepaliveInterval = 60 > > transport.heartbeatTimeout = 60 > > 2、部分客户端插件注册间隔时间设置为0。如openwrt中 > > 大家可以试试,有用点赞呢 加上第一点配置之后可以多连接几秒,但是还是会断线,第二点怎么设置?
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#1778
No description provided.