服务端:
[root@yunwei frp]# more frps.ini
[common]
bind_addr = 0.0.0.0
bind_port = 7200
bind_udp_port = 7201
kcp_bind_port = 7200
vhost_http_port = 80
vhost_https_port = 443
dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = AL1EVZoQ1pbRit1m1
log_file = ./frps.log
log_level = debug
log_max_days = 3
token = JBKKdGKhIfeNrsWg1
max_pool_count = 5
max_ports_per_client = 0
authentication_timeout = 900
tcp_mux = true
客户端1:
[common]
admin_addr = 127.0.0.1
admin_port = 7400
server_addr = 172.16.111.19 #服务端本机内网IP
server_port = 7200
token = JBKKdGKhIfeNrsWg1
#---------------------------------------------------
[httpsapis2]
type = https
local_ip = 127.0.0.1
local_port = 2280
remote_port = 2280
use_encryption = false
use_compression = true
custom_domains = apis2.youpeng.com
[httplotterydraw2]
type = http
local_ip = 127.0.0.1
local_port = 1280
remote_port = 80
use_encryption = false
use_compression = true
custom_domains = lotterydraw2.youpeng.com
客户端2:
[root@localhost frp]# more frpc.ini
[common]
server_addr = 47.110.7.7
server_port = 7200
token = JBKKdGKhIfeNrsWg1
admin_addr = 127.0.0.1
admin_port = 7400
[httpswww1]
type = https
local_ip = 192.168.0.21
local_port = 443
remote_port = 443
use_encryption = false
use_compression = true
use_gzip = true
custom_domains =www1.youpeng.com
[httpm1]
type = http
local_ip = 192.168.0.21
local_port = 80
remote_port = 80
use_encryption = false
use_compression = true
use_gzip = true
custom_domains =m1.youpeng.com
相关启动命令
[root@yunwei frp]# more startfrpc.sh
nohup ./frpc -c frpc.ini &
[root@yunwei frp]# more startfrps.sh
nohup ./frps -c frps.ini &
[root@yunwei frp]# more reload-frpc.sh
./frpc reload -c frpc.ini