frp透传软件最新toml格式的配置文件的使用

2023-12-29 19:02:49

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即可

文章来源:https://blog.csdn.net/lggirls/article/details/135295298
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。