[GH-ISSUE #3225] 无法单独运行在quic模式 #2586

Closed
opened 2026-05-05 13:39:51 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @aa51513 on GitHub (Dec 22, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3225

Bug Description

启动frps,无论是否配置bind_port字段,都会监听7000/tcp端口
这显然是不合理的

因为frps可以运行在kcp模式,或者quic模式,在这两种情况下,在端口7000上的tcp监听显然是没有必要的

另外示例配置文件里的bind_udp_port = 7001端口是做什么用途的,也不明确,不知道如何使用

frpc Version

0.46.0

frps Version

0.46.0

System Architecture

linux/amd64

Configurations

[common]
bind_port = 7000
quic_bind_port = 7002

[common]
server_addr = my.server.com
server_port = 7002
token = abc123
protocol = quic

[my_ssh_tunnel]
type = stcp
sk = imthebest996
local_ip = 127.0.0.1
local_port = 3389

Logs

none

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 @aa51513 on GitHub (Dec 22, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/3225 ### Bug Description 启动frps,无论是否配置bind_port字段,都会监听7000/tcp端口 这显然是不合理的 因为frps可以运行在kcp模式,或者quic模式,在这两种情况下,在端口7000上的tcp监听显然是没有必要的 另外示例配置文件里的bind_udp_port = 7001端口是做什么用途的,也不明确,不知道如何使用 ### frpc Version 0.46.0 ### frps Version 0.46.0 ### System Architecture linux/amd64 ### Configurations [common] bind_port = 7000 quic_bind_port = 7002 [common] server_addr = my.server.com server_port = 7002 token = abc123 protocol = quic [my_ssh_tunnel] type = stcp sk = imthebest996 local_ip = 127.0.0.1 local_port = 3389 ### Logs none ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:39:51 -06:00
Author
Owner

@superzjg commented on GitHub (Dec 23, 2022):

0.46版本。我试了。frps必须要定义quic_bind_port才能开启quic,且要把quic_bind_port设为与bind_port端口号一样(前者是UDP后者是TCP),frpc才能protocol = quic 连接成功。如果设为不同的端口号无法连接上。(ps:kcp的端口kcp_bind_port也需要与bind_port一样,才能连接,不知是不是bug。既然要设为一样,所以quic和kcp不能同时开启)
连接成功后测试,流量确实是走的udp,简单复制文件测试,比tcp和kcp要快(kcp最慢)。

<!-- gh-comment-id:1363616558 --> @superzjg commented on GitHub (Dec 23, 2022): 0.46版本。我试了。frps必须要定义quic_bind_port才能开启quic,且**要把quic_bind_port设为与bind_port端口号一样**(前者是UDP后者是TCP),frpc才能protocol = quic 连接成功。如果设为不同的端口号无法连接上。(ps:kcp的端口kcp_bind_port也需要与bind_port一样,才能连接,不知是不是bug。既然要设为一样,所以quic和kcp不能同时开启) 连接成功后测试,流量确实是走的udp,简单复制文件测试,比tcp和kcp要快(kcp最慢)。
Author
Owner

@fatedier commented on GitHub (Dec 23, 2022):

因为 bind_port 的默认值就是 7000,可以考虑支持配置为 < 0 的值来关闭 TCP 的端口监听。

<!-- gh-comment-id:1363656862 --> @fatedier commented on GitHub (Dec 23, 2022): 因为 `bind_port` 的默认值就是 7000,可以考虑支持配置为 `< 0` 的值来关闭 TCP 的端口监听。
Author
Owner

@fatedier commented on GitHub (Dec 23, 2022):

0.46版本。我试了。frps必须要定义quic_bind_port才能开启quic,且要把quic_bind_port设为与bind_port端口号一样(前者是UDP后者是TCP),frpc才能protocol = quic 连接成功。如果设为不同的端口号无法连接上。(ps:kcp的端口kcp_bind_port也需要与bind_port一样,才能连接,不知是不是bug。既然要设为一样,所以quic和kcp不能同时开启) 连接成功后测试,流量确实是走的udp,简单复制文件测试,比tcp和kcp要快(kcp最慢)。

无法复现这个问题。

<!-- gh-comment-id:1363657445 --> @fatedier commented on GitHub (Dec 23, 2022): > 0.46版本。我试了。frps必须要定义quic_bind_port才能开启quic,且**要把quic_bind_port设为与bind_port端口号一样**(前者是UDP后者是TCP),frpc才能protocol = quic 连接成功。如果设为不同的端口号无法连接上。(ps:kcp的端口kcp_bind_port也需要与bind_port一样,才能连接,不知是不是bug。既然要设为一样,所以quic和kcp不能同时开启) 连接成功后测试,流量确实是走的udp,简单复制文件测试,比tcp和kcp要快(kcp最慢)。 无法复现这个问题。
Author
Owner

@superzjg commented on GitHub (Dec 23, 2022):

0.46版本。我试了。frps必须要定义quic_bind_port才能开启quic,且要把quic_bind_port设为与bind_port端口号一样(前者是UDP后者是TCP),frpc才能protocol = quic 连接成功。如果设为不同的端口号无法连接上。(ps:kcp的端口kcp_bind_port也需要与bind_port一样,才能连接,不知是不是bug。既然要设为一样,所以quic和kcp不能同时开启) 连接成功后测试,流量确实是走的udp,简单复制文件测试,比tcp和kcp要快(kcp最慢)。

无法复现这个问题。

抱歉,我弄错了,我忘记修改frpc中server_port 为quic_bind_port,所以没连上...

<!-- gh-comment-id:1363665407 --> @superzjg commented on GitHub (Dec 23, 2022): > > 0.46版本。我试了。frps必须要定义quic_bind_port才能开启quic,且**要把quic_bind_port设为与bind_port端口号一样**(前者是UDP后者是TCP),frpc才能protocol = quic 连接成功。如果设为不同的端口号无法连接上。(ps:kcp的端口kcp_bind_port也需要与bind_port一样,才能连接,不知是不是bug。既然要设为一样,所以quic和kcp不能同时开启) 连接成功后测试,流量确实是走的udp,简单复制文件测试,比tcp和kcp要快(kcp最慢)。 > > 无法复现这个问题。 抱歉,我弄错了,我**忘记修改frpc中server_port 为quic_bind_port**,所以没连上...
Author
Owner

@qyh214 commented on GitHub (May 9, 2023):

服务器的安全组已经开放所有流量和协议,server_port 和quic_bind_port都是7000,服务器也没启用防火墙,但是本地内网的计算机使用protocol = quic时,就会报login server fail timeout,换回tcp就能连上……

<!-- gh-comment-id:1539329500 --> @qyh214 commented on GitHub (May 9, 2023): 服务器的安全组已经开放所有流量和协议,server_port 和quic_bind_port都是7000,服务器也没启用防火墙,但是本地内网的计算机使用protocol = quic时,就会报login server fail timeout,换回tcp就能连上……
Author
Owner

@github-actions[bot] commented on GitHub (Feb 16, 2024):

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

<!-- gh-comment-id:1947559933 --> @github-actions[bot] commented on GitHub (Feb 16, 2024): Issues go stale after 21d 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#2586
No description provided.