1. 下载地址

https://github.com/fatedier/frp/releases
比如 v0.50.0版本

2. 服务端配置 frps & frps.ini

[common]
log_file = ./frps.log
dashboard_user = XXXXX
dashboard_pwd = XXXX
authentication_method = token
token = XXX

dashboard_addr = 0.0.0.0
dashboard_port = 7500

vhost_http_port = 7090
vhost_https_port = 7443

bind_addr = 0.0.0.0
bind_port = 7000
bind_udp_port = 7000

3、服务器端启动(nohup, better by systemd or supervisor)

killall -9 frps
nohup /root/frp/frps -c /root/frp/frps.ini > frps.log &
ps -aux | grep frps

3、客户端配置 frpc & frpc.ini

[common]
server_addr = [Your Server IP, it's your sever public ip]
server_port = 7000
authentication_method = token
token = XXXXX

[nas] #取有意义的名字,代理本地ssh端口
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6006

[note] #取有意义的名字,代理本地HTTP服务, 域名定义
type = http
local_port = 8096
custom_domains = demo.XXXX.com

4、客户端配置启动方法1(nohup)

killall -9 frpc
nohup /opt/frp/frpc -c /opt/frp/frpc.ini > frpc.log &
ps -aux | grep frpc

5、客户端配置启动方法2(supervisor)

$ sudo apt -y install supervisor

$ vim /etc/supervisor/conf.d/frp.conf

[program:frpc]
command=/home/xxxx/frp/frpc -c /home/xxxx/frp/frpc.ini
stderr_logfile=/home/xxxx/frp/frpc.log
stdout_logfile=/home/xxxx/frp/frpc.log
#directory=/home/xxxx/frp
autostart=true  
user=xxxx
autorestart=true
startsecs=30

$ sudo supervisorctl reload
即可运行
$ sudo supervisorctl status
查看状态