[GH-ISSUE #4789] 使用端口范围映射时,frps重启,frpc自动连接失败,不确定是否是端口范围太大造成 #3780

Closed
opened 2026-05-05 14:25:18 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @lockqueen on GitHub (May 6, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4789

Bug Description

端口范围映射内容如下:

{{- range $_, $v := parseNumberRangePair  "7777,8014-8050,8114-8150,8887,8888,9100,9010-9031" "7777,8014-8050,8114-8150,8887,8888,9100,9010-9031" }}
[[proxies]]
name = "{{ $v.First }}-demo"
type = "tcp"
localIP = "192.168.0.122"
localPort = {{ $v.First }}
remotePort = {{ $v.Second }}
{{- end }}

frps重启时,frpc会出现:

send heartbeat to server
send heartbeat to server
send heartbeat to server
send heartbeat to server
heartbeat timeout

只能手动重启frpc,然后就正常连接上了。

配置修改端口少一些,如下:

{{- range $_, $v := parseNumberRangePair  "8014-8050" "8014-8050" }}
[[proxies]]
name = "{{ $v.First }}-demo"
type = "tcp"
localIP = "192.168.0.122"
localPort = {{ $v.First }}
remotePort = {{ $v.Second }}
{{- end }}

重启frps的时候,frpc就能自己重连上。。不确定是不是端口数量太多触发的问题。如果有端口数量限制,请问下是多少。。端口数量多的话,是不是要多用几个frpc,不能放在同一个frpc...

frpc Version

v0.61.2

frps Version

v0.61.2

System Architecture

linux/amd64

Configurations

{{- range $_, $v := parseNumberRangePair "7777,8014-8050,8114-8150,8887,8888,9100,9010-9031" "7777,8014-8050,8114-8150,8887,8888,9100,9010-9031" }}
proxies
name = "{{ $v.First }}-demo"
type = "tcp"
localIP = "192.168.0.122"
localPort = {{ $v.First }}
remotePort = {{ $v.Second }}
{{- end }}

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @lockqueen on GitHub (May 6, 2025). Original GitHub issue: https://github.com/fatedier/frp/issues/4789 ### Bug Description 端口范围映射内容如下: ``` {{- range $_, $v := parseNumberRangePair "7777,8014-8050,8114-8150,8887,8888,9100,9010-9031" "7777,8014-8050,8114-8150,8887,8888,9100,9010-9031" }} [[proxies]] name = "{{ $v.First }}-demo" type = "tcp" localIP = "192.168.0.122" localPort = {{ $v.First }} remotePort = {{ $v.Second }} {{- end }} ``` frps重启时,frpc会出现: ``` send heartbeat to server send heartbeat to server send heartbeat to server send heartbeat to server heartbeat timeout ``` 只能手动重启frpc,然后就正常连接上了。 配置修改端口少一些,如下: ``` {{- range $_, $v := parseNumberRangePair "8014-8050" "8014-8050" }} [[proxies]] name = "{{ $v.First }}-demo" type = "tcp" localIP = "192.168.0.122" localPort = {{ $v.First }} remotePort = {{ $v.Second }} {{- end }} ``` 重启frps的时候,frpc就能自己重连上。。不确定是不是端口数量太多触发的问题。如果有端口数量限制,请问下是多少。。端口数量多的话,是不是要多用几个frpc,不能放在同一个frpc... ### frpc Version v0.61.2 ### frps Version v0.61.2 ### System Architecture linux/amd64 ### Configurations {{- range $_, $v := parseNumberRangePair "7777,8014-8050,8114-8150,8887,8888,9100,9010-9031" "7777,8014-8050,8114-8150,8887,8888,9100,9010-9031" }} [[proxies]] name = "{{ $v.First }}-demo" type = "tcp" localIP = "192.168.0.122" localPort = {{ $v.First }} remotePort = {{ $v.Second }} {{- end }} ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@lockqueen commented on GitHub (May 6, 2025):

额。。的确是,用两个frpc,把端口分开,就能满足端口开放需要了,貌似frpc的确有端口数量限制的样子。。

<!-- gh-comment-id:2854918114 --> @lockqueen commented on GitHub (May 6, 2025): 额。。的确是,用两个frpc,把端口分开,就能满足端口开放需要了,貌似frpc的确有端口数量限制的样子。。
Author
Owner

@jiangtaixing commented on GitHub (Sep 9, 2025):

这个问题修复了吗

<!-- gh-comment-id:3269156318 --> @jiangtaixing commented on GitHub (Sep 9, 2025): 这个问题修复了吗
Author
Owner

@ratyzhang commented on GitHub (Sep 19, 2025):

也遇到同样的问题了

<!-- gh-comment-id:3310833357 --> @ratyzhang commented on GitHub (Sep 19, 2025): 也遇到同样的问题了
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#3780
No description provided.