官方文档
需要有公网服务器
下载 Frp 到服务器
下载
解压
$ tar zxvf frp_0.29.1_linux_amd64.tar.gz
上传
$ scp frps frps.ini root@192.168.0.124:/root/frps
配置
frpc
[common]
server_addr = 39.105.141.168
server_port = 7000
# for authentication
# token = 12345678
[dev1]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
[web]
type = https
local_port = 443
custom_domains = abser.top
fprs
# [common] is integral section
[common]
# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
bind_addr = 0.0.0.0
bind_port = 7000
# udp port to help make udp hole to penetrate nat
bind_udp_port = 7001
# udp port used for kcp protocol, it can be same with 'bind_port'
# if not set, kcp is disabled in frps
kcp_bind_port = 7000
# if you want to support virtual host, you must set the http port for listening (optional)
# Note: http port and https port can be same with bind_port
vhost_http_port = 8000
vhost_https_port = 4430
# set dashboard_addr and dashboard_port to view dashboard of frps
# dashboard_addr's default value is same with bind_addr
# dashboard is available only if dashboard_port is set
dashboard_addr = 0.0.0.0
dashboard_port = 7500
# dashboard user and passwd for basic auth protect, if not set, both default value is admin
dashboard_user = admin
dashboard_pwd = admin
# dashboard assets directory(only for debug mode)
# assets_dir = ./static
# console or real logFile path like ./frps.log
log_file = ./frps.log
# trace, debug, info, warn, error
log_level = info
log_max_days = 3
# disable log colors when log_file is console, default is false
disable_log_color = false
# max ports can be used for each client, default value is 0 means no limit
max_ports_per_client = 0
# if tcp stream multiplexing is used, default is true
tcp_mux = true
防火墙
阿里云
宝塔
或者关闭防火墙也行
启动与停止
centos 环境
运行
$ nohup ./frps -c frps.ini >/dev/null 2>&1 &
或者客户端:
$ nohup ./frpc -c ./frpc.ini >/dev/null 2>&1 &
停止
找到这个进程
$ ps -aux|grep frp| grep -v grep
root 3600 0.1 0.1 110188 9484 pts/0 Sl 15:04 0:00 ./frpc -c ./frpc.ini
kill
$ kill -9 3600