frp软件在0.52.0版本开始支持 toml格式的配置文件了,并将在后继某个版本开始取消对 ini配置格式的支持。这里做一下新旧配置文件的比较。
一、frps 服务端配置文件的变化
frps.ini
cat /etc/frp/frps.ini
[common]
bind_port=7000
vhost_http_port=8080
vhost_https_port=45443
frps.toml
cat /etc/frp/frps.toml
bindPort=7000
vhostHTTPPort=8080
vhostHTTPSPort=45443
二、 frpc 客户端配置文件的变化
frpc.ini
cat /etc/frp/frpc.ini
[common]
server_addr = www.your-frps-service.com
server_port = 7000
[ssh-80]
type = tcp
local_ip = 127.0.0.1
local_port = 45080
remote_port = 45080
[web-80]
type = https
local_port = 45443
custom_domains = cloud.your-service.com
frpc.toml
cat /etc/frp/frpc.toml
serverAddr = "www.your-frps-service.com"
serverPort = 7000
[[proxies]]
name = "ssh-80"
type = "tcp"
localIP = "127.0.0.1"
localPort = 45080
remotePort = 45080
[[proxies]]
name = "web-80"
type = "https"
localPort = 45443
customDomains = ["cloud.your-service.com"]
三、 systemd自启动服务
cat /etc/systemd/system/frps.service
[Unit]
Description = frp server
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
ExecStart = /usr/bin/frps -c /etc/frp/frps.toml
[Install]
WantedBy = multi-user.target
frpc 服务的配置文件类似,将 frps? 替换为 frpc即可