Skip to main content

Gofrp内网穿透配置

Frp Client 配置systemd

配置文件路径

vim /etc/systemd/system/frpc.service

配置文件内容

[Unit]
# 服务名称,可自定义
Description = frp client
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
# 启动frpc的命令,需修改为您的frpc的安装路径
ExecStart = /root/frp_0.54.0_linux_amd64/frpc -c /root/frp_0.54.0_linux_amd64/frpc.toml
#ExecStart = /root/frp_0.55.0_linux_amd64/frpc -c /root/frp_0.55.0_linux_amd64/frpc.toml

[Install]
WantedBy = multi-user.target

启动程序

# 重载配置
systemctl daemon-reload

# 启动客户端
systemctl start frpc

# 开机自启动
systemctl enable frpc

Frp Server 配置systemd

配置文件路径

vim /etc/systemd/system/frps.service

配置文件内容

[Unit]
# 服务名称,可自定义
Description = frp server
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /root/frp_0.54.0_linux_amd64/frps -c /root/frp_0.54.0_linux_amd64/frps.toml

[Install]
WantedBy = multi-user.target

启动程序

# 重载配置
systemctl daemon-reload

# 启动客户端
systemctl start frps

# 开机自启动
systemctl enable frps

HTTP内网穿透配置-客户端

serverAddr = "101.34.186.101"
serverPort = 7000

[[proxies]]
name = "web"
type = "http"
localIP = "127.0.0.1"
localPort = 80
customDomains=["limi.website.com"]

HTTP内网穿透配置-服务端

bindPort = 7000
vhostHTTPPort = 8081