frps frps.ini 服务器端配置

[common]
bind_port = 7000
vhost_http_port = 17000
dashboard_port = 17500
dashboard_user = admin   # 控制台用户名
dashboard_pwd = xxxxxx   # 控制台密码
# auth
authentication_method = token      # 认证方式, token
authenticate_new_work_conns = true # 认证方式, 开启连接时校验
token = xxxxxxxxxxxxxxxxx   # token, 随便填, 客户端配置需要一样

使用时, 请删除注释

frpc frpc.ini 客户端配置, 这里使用了多个穿透代理

[common]
server_addr = x.x.x.x  # frps 服务器ip
server_port = 7000
# auth 和服务端保持一致
authentication_method = token
authenticate_new_work_conns = true
token = xxxxxxxxxxx   
tls_enable = true

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 8089
remote_port = 18089

[ssh1]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 10022

这样配置服务器就会使用 token 进行认证, 不符合的连接就会拦截

2021/12/20 08:36:01 [E] [service.go:292] token in login doesn't match token from configuration
2021/12/20 08:36:01 [W] [service.go:104] login to server failed: token in login doesn't match token from configuration
token in login doesn't match token from configuration
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐