[GH-ISSUE #4704] frpc 无法正常添加visitor #3713

Closed
opened 2026-05-05 14:22:58 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @zhaodice on GitHub (Mar 10, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4704

Bug Description

当我执行frpc -c frpc.toml 的时候
(为了便于复现,我把proxy和visitor写在一起了,分开也是一样的)
理论上此时应该监听6000端口,但启动的时候

netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
tcp6       0      0 :::5355                 :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
udp        0      0 127.0.0.53:53           0.0.0.0:*                          
udp        0      0 0.0.0.0:68              0.0.0.0:*                          
udp        0      0 0.0.0.0:5355            0.0.0.0:*                          
udp6       0      0 fe80::5820:7aff:fe8:546 :::*                               
udp6       0      0 :::5355                 :::* 

p2p_ssh_visitor 并没有对6000端口进行监听,像是frpc在空转,没有监听任何端口,很奇怪的现象,但没有发现配置文件哪里出了问题。。。

frpc Version

0.61.2

frps Version

0.61.2

System Architecture

linux/amd64

Configurations

frps.toml

[common]
bindPort = 7000
auth.token = "*"

dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin

frpc.toml

[common]
server_addr = "*"
server_port = 7000
auth.token = "*"

[[proxies]]
name = "p2p_ssh"
type = "xtcp"
secretKey = "abcdefg"
localIP = "127.0.0.1"
localPort = 22

[[visitors]]
name = "p2p_ssh_visitor"
type = "xtcp"
serverName = "p2p_ssh"
secretKey = "abcdefg"
bindAddr = "127.0.0.1"
bindPort = 6000

Logs

CLIENT:

2025-03-10 20:59:28.756 [I] [sub/root.go:142] start frpc service for config file [./frpc.toml]
2025-03-10 20:59:28.756 [I] [client/service.go:295] try to connect to server...
2025-03-10 20:59:28.804 [I] [client/service.go:287] [41b64a704fb5d85a] login to server success, get run id [41b64a704fb5d85a]
2025-03-10 20:59:28.804 [I] [proxy/proxy_manager.go:173] [41b64a704fb5d85a] proxy added: [[proxies] [visitors]]
2025-03-10 20:59:28.819 [I] [client/control.go:168] [41b64a704fb5d85a] [[visitors]] start proxy success
2025-03-10 20:59:28.819 [I] [client/control.go:168] [41b64a704fb5d85a] [[proxies]] start proxy success

SERVER:

2025-03-11 04:47:22.362 [I] [server/service.go:582] [1547aec048acc14d] client login info: ip [:34694] version [0.61.2] hostname [] os [linux] arch [amd64]
2025-03-11 04:47:22.378 [I] [server/control.go:399] [1547aec048acc14d] new proxy [[proxies]] type [xtcp] success
2025-03-11 04:47:22.378 [I] [server/control.go:399] [1547aec048acc14d] new proxy [[visitors]] type [xtcp] success
2025-03-11 04:48:43.888 [I] [proxy/proxy.go:115] [1547aec048acc14d] [[proxies]] proxy closing
2025-03-11 04:48:43.888 [I] [proxy/proxy.go:115] [1547aec048acc14d] [[visitors]] proxy closing
2025-03-11 04:48:43.888 [I] [server/control.go:357] [1547aec048acc14d] client exit success

Steps to reproduce

  1. 使用上述frpc.toml配置
  2. 执行frpc -c frpc.toml
  3. 发现并没有监听任何端口,尽管日志看起来都是正常的,没有报错,visitor也被识别成proxy了
    ...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @zhaodice on GitHub (Mar 10, 2025). Original GitHub issue: https://github.com/fatedier/frp/issues/4704 ### Bug Description 当我执行frpc -c frpc.toml 的时候 (为了便于复现,我把proxy和visitor写在一起了,分开也是一样的) 理论上此时应该监听6000端口,但启动的时候 ``` netstat -tuln Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp6 0 0 ::1:25 :::* LISTEN tcp6 0 0 :::5355 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN udp 0 0 127.0.0.53:53 0.0.0.0:* udp 0 0 0.0.0.0:68 0.0.0.0:* udp 0 0 0.0.0.0:5355 0.0.0.0:* udp6 0 0 fe80::5820:7aff:fe8:546 :::* udp6 0 0 :::5355 :::* ``` p2p_ssh_visitor 并没有对6000端口进行监听,像是frpc在空转,没有监听任何端口,很奇怪的现象,但没有发现配置文件哪里出了问题。。。 ### frpc Version 0.61.2 ### frps Version 0.61.2 ### System Architecture linux/amd64 ### Configurations frps.toml ``` [common] bindPort = 7000 auth.token = "*" dashboard_port = 7500 dashboard_user = admin dashboard_pwd = admin ``` frpc.toml ``` [common] server_addr = "*" server_port = 7000 auth.token = "*" [[proxies]] name = "p2p_ssh" type = "xtcp" secretKey = "abcdefg" localIP = "127.0.0.1" localPort = 22 [[visitors]] name = "p2p_ssh_visitor" type = "xtcp" serverName = "p2p_ssh" secretKey = "abcdefg" bindAddr = "127.0.0.1" bindPort = 6000 ``` ### Logs CLIENT: ``` 2025-03-10 20:59:28.756 [I] [sub/root.go:142] start frpc service for config file [./frpc.toml] 2025-03-10 20:59:28.756 [I] [client/service.go:295] try to connect to server... 2025-03-10 20:59:28.804 [I] [client/service.go:287] [41b64a704fb5d85a] login to server success, get run id [41b64a704fb5d85a] 2025-03-10 20:59:28.804 [I] [proxy/proxy_manager.go:173] [41b64a704fb5d85a] proxy added: [[proxies] [visitors]] 2025-03-10 20:59:28.819 [I] [client/control.go:168] [41b64a704fb5d85a] [[visitors]] start proxy success 2025-03-10 20:59:28.819 [I] [client/control.go:168] [41b64a704fb5d85a] [[proxies]] start proxy success ``` SERVER: ``` 2025-03-11 04:47:22.362 [I] [server/service.go:582] [1547aec048acc14d] client login info: ip [:34694] version [0.61.2] hostname [] os [linux] arch [amd64] 2025-03-11 04:47:22.378 [I] [server/control.go:399] [1547aec048acc14d] new proxy [[proxies]] type [xtcp] success 2025-03-11 04:47:22.378 [I] [server/control.go:399] [1547aec048acc14d] new proxy [[visitors]] type [xtcp] success 2025-03-11 04:48:43.888 [I] [proxy/proxy.go:115] [1547aec048acc14d] [[proxies]] proxy closing 2025-03-11 04:48:43.888 [I] [proxy/proxy.go:115] [1547aec048acc14d] [[visitors]] proxy closing 2025-03-11 04:48:43.888 [I] [server/control.go:357] [1547aec048acc14d] client exit success ``` ### Steps to reproduce 1. 使用上述frpc.toml配置 2. 执行frpc -c frpc.toml 3. 发现并没有监听任何端口,尽管日志看起来都是正常的,没有报错,visitor也被识别成proxy了 ... ### Affected area - [ ] Docs - [x] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@zhaodice commented on GitHub (Mar 11, 2025):

[common]
server_addr = "*"
server_port = 7000
auth.token = "*"

改成

serverAddr = "*"
serverPort = 7000
auth.token = "*"
auth.method= "token"

就好了,但这个配置也不能说有问题吧。。。奇了怪了

<!-- gh-comment-id:2713052067 --> @zhaodice commented on GitHub (Mar 11, 2025): ``` [common] server_addr = "*" server_port = 7000 auth.token = "*" ``` 改成 ``` serverAddr = "*" serverPort = 7000 auth.token = "*" auth.method= "token" ``` 就好了,但这个配置也不能说有问题吧。。。奇了怪了
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#3713
No description provided.