[GH-ISSUE #1809] centos8.1无法使用指定配置文件 #1428

Closed
opened 2026-05-05 12:54:02 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @linmii on GitHub (May 15, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1809

当前使用版本

客户端:frp_0.33.0_windows_amd64.zip
服务端:frp_0.33.0_linux_amd64.tar.gz

服务端配置

# frp监听的端口,用作服务端和客户端通信
bind_port = 7070
token = a_unique_token
tls_enable = true

# 服务端通过此端口接监听和接收公网用户的http请求
vhost_http_port = 7071

# frp提供了一个控制台,可以通过这个端口访问到控制台。可查看frp当前有多少代理连接以及对应的状态
dashboard_port = 7500

客户端配置

[common]
# 部署frp服务端的公网服务器的ip
server_addr = 服务器的公网ip
# 和服务端的bind_port保持一致
server_port = 7070
token = a_unique_token
tls_enable = true

[http-a]
type = http
local_port = 10004
subdomain = a

启动服务端

运行命令:./frps -c ./frps.ini
输出日志:

2020/05/15 22:34:48 [I] [service.go:178] frps tcp listen on 0.0.0.0:7000
2020/05/15 22:34:48 [I] [root.go:209] start frps success

开启的端口是7000,默认端口,而不是配置文件中的7070

启动客户端

运行命令:.\frpc.exe -c .\frpc.ini
输出日志:

2020/05/15 22:35:37 [W] [service.go:101] login to server failed: dial tcp 公网ip:7070: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
dial tcp 公网ip:7070: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

更改客户端配置

服务端配置不改动,客户端更改配置7000端口

服务端输出日志:

2020/05/15 22:34:48 [I] [service.go:178] frps tcp listen on 0.0.0.0:7000
2020/05/15 22:34:48 [I] [root.go:209] start frps success
2020/05/15 22:39:54 [I] [service.go:432] [5810d6651d220373] client login info: ip [客户端ip:17808] version [0.33.0] hostname [] os [windows] arch [amd64]
2020/05/15 22:39:54 [W] [service.go:334] register control error: token in login doesn't match token from configuration

客户端输出日志:

2020/05/15 22:39:55 [E] [service.go:273] token in login doesn't match token from configuration
2020/05/15 22:39:55 [W] [service.go:101] login to server failed: token in login doesn't match token from configuration
token in login doesn't match token from configuration

提示token不匹配

再次更改客户端配置

服务端配置不改动,客户端配置将token的配置注释

服务端输出日志:

2020/05/15 22:43:16 [I] [service.go:178] frps tcp listen on 0.0.0.0:7000
2020/05/15 22:43:16 [I] [root.go:209] start frps success
2020/05/15 22:43:37 [I] [service.go:432] [e8a122a4d3480904] client login info: ip [客户端ip:17940] version [0.33.0] hostname [] os [windows] arch [amd64]
2020/05/15 22:43:37 [W] [control.go:441] [e8a122a4d3480904] new proxy [http-a] error: type [http] not support when vhost_http_port is not set

客户端输出日志:

2020/05/15 22:43:37 [I] [service.go:282] [e8a122a4d3480904] login to server success, get run id [e8a122a4d3480904], server udp port [0]
2020/05/15 22:43:37 [I] [proxy_manager.go:144] [e8a122a4d3480904] proxy added: [http-a]
2020/05/15 22:43:37 [W] [control.go:177] [e8a122a4d3480904] [http-a] start error: type [http] not support when vhost_http_port is not set

服务端配置中有配置vhost_http_port

Originally created by @linmii on GitHub (May 15, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1809 ### 当前使用版本 客户端:`frp_0.33.0_windows_amd64.zip` 服务端:`frp_0.33.0_linux_amd64.tar.gz` ### 服务端配置 ``` # frp监听的端口,用作服务端和客户端通信 bind_port = 7070 token = a_unique_token tls_enable = true # 服务端通过此端口接监听和接收公网用户的http请求 vhost_http_port = 7071 # frp提供了一个控制台,可以通过这个端口访问到控制台。可查看frp当前有多少代理连接以及对应的状态 dashboard_port = 7500 ``` ### 客户端配置 ``` [common] # 部署frp服务端的公网服务器的ip server_addr = 服务器的公网ip # 和服务端的bind_port保持一致 server_port = 7070 token = a_unique_token tls_enable = true [http-a] type = http local_port = 10004 subdomain = a ``` ### 启动服务端 运行命令:`./frps -c ./frps.ini` 输出日志: ``` 2020/05/15 22:34:48 [I] [service.go:178] frps tcp listen on 0.0.0.0:7000 2020/05/15 22:34:48 [I] [root.go:209] start frps success ``` 开启的端口是`7000`,默认端口,而不是配置文件中的`7070` ### 启动客户端 运行命令:`.\frpc.exe -c .\frpc.ini` 输出日志: ``` 2020/05/15 22:35:37 [W] [service.go:101] login to server failed: dial tcp 公网ip:7070: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. dial tcp 公网ip:7070: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ``` ### 更改客户端配置 服务端配置不改动,客户端更改配置`7000`端口 服务端输出日志: ``` 2020/05/15 22:34:48 [I] [service.go:178] frps tcp listen on 0.0.0.0:7000 2020/05/15 22:34:48 [I] [root.go:209] start frps success 2020/05/15 22:39:54 [I] [service.go:432] [5810d6651d220373] client login info: ip [客户端ip:17808] version [0.33.0] hostname [] os [windows] arch [amd64] 2020/05/15 22:39:54 [W] [service.go:334] register control error: token in login doesn't match token from configuration ``` 客户端输出日志: ``` 2020/05/15 22:39:55 [E] [service.go:273] token in login doesn't match token from configuration 2020/05/15 22:39:55 [W] [service.go:101] login to server failed: token in login doesn't match token from configuration token in login doesn't match token from configuration ``` ***提示`token`不匹配*** ### 再次更改客户端配置 服务端配置不改动,客户端配置将`token`的配置注释 服务端输出日志: ``` 2020/05/15 22:43:16 [I] [service.go:178] frps tcp listen on 0.0.0.0:7000 2020/05/15 22:43:16 [I] [root.go:209] start frps success 2020/05/15 22:43:37 [I] [service.go:432] [e8a122a4d3480904] client login info: ip [客户端ip:17940] version [0.33.0] hostname [] os [windows] arch [amd64] 2020/05/15 22:43:37 [W] [control.go:441] [e8a122a4d3480904] new proxy [http-a] error: type [http] not support when vhost_http_port is not set ``` 客户端输出日志: ``` 2020/05/15 22:43:37 [I] [service.go:282] [e8a122a4d3480904] login to server success, get run id [e8a122a4d3480904], server udp port [0] 2020/05/15 22:43:37 [I] [proxy_manager.go:144] [e8a122a4d3480904] proxy added: [http-a] 2020/05/15 22:43:37 [W] [control.go:177] [e8a122a4d3480904] [http-a] start error: type [http] not support when vhost_http_port is not set ``` ***服务端配置中有配置`vhost_http_port`***
Author
Owner

@xqzr commented on GitHub (May 15, 2020):

frps没有tls_enable

<!-- gh-comment-id:629313467 --> @xqzr commented on GitHub (May 15, 2020): frps没有tls_enable
Author
Owner

@linmii commented on GitHub (May 16, 2020):

frps没有tls_enable

注释了也是一样

<!-- gh-comment-id:629573690 --> @linmii commented on GitHub (May 16, 2020): > frps没有tls_enable 注释了也是一样
Author
Owner

@fatedier commented on GitHub (May 16, 2020):

先确认是否执行了正确的命令,其他人无法复现问题,通常是一些特殊的环境问题或输入错误导致的。

<!-- gh-comment-id:629629143 --> @fatedier commented on GitHub (May 16, 2020): 先确认是否执行了正确的命令,其他人无法复现问题,通常是一些特殊的环境问题或输入错误导致的。
Author
Owner

@linmii commented on GitHub (May 16, 2020):

先确认是否执行了正确的命令,其他人无法复现问题,通常是一些特殊的环境问题或输入错误导致的。

确实是配置文件的问题,应该是从之前的配置中复制过来的时候,右键粘贴导致[common]丢失了,感谢!

<!-- gh-comment-id:629633409 --> @linmii commented on GitHub (May 16, 2020): > 先确认是否执行了正确的命令,其他人无法复现问题,通常是一些特殊的环境问题或输入错误导致的。 确实是配置文件的问题,应该是从之前的配置中复制过来的时候,右键粘贴导致`[common]`丢失了,感谢!
Author
Owner

@dumpload commented on GitHub (Nov 23, 2020):

我也有这个问题,不配置token就可以,配置token就不行

<!-- gh-comment-id:731967084 --> @dumpload commented on GitHub (Nov 23, 2020): 我也有这个问题,不配置token就可以,配置token就不行
Author
Owner

@qiyuanshijie commented on GitHub (Dec 31, 2020):

我也是版本0.34.3,前几天还好点

<!-- gh-comment-id:752952815 --> @qiyuanshijie commented on GitHub (Dec 31, 2020): 我也是版本0.34.3,前几天还好点
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#1428
No description provided.