官方文档
需要有公网服务器
下载 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.168server_port = 7000# for authentication# token = 12345678[dev1]type = tcplocal_ip = 127.0.0.1local_port = 22remote_port = 6000[web]type = httpslocal_port = 443custom_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.0bind_port = 7000# udp port to help make udp hole to penetrate natbind_udp_port = 7001# udp port used for kcp protocol, it can be same with 'bind_port'# if not set, kcp is disabled in frpskcp_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_portvhost_http_port = 8000vhost_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 setdashboard_addr = 0.0.0.0dashboard_port = 7500# dashboard user and passwd for basic auth protect, if not set, both default value is admindashboard_user = admindashboard_pwd = admin# dashboard assets directory(only for debug mode)# assets_dir = ./static# console or real logFile path like ./frps.loglog_file = ./frps.log# trace, debug, info, warn, errorlog_level = infolog_max_days = 3# disable log colors when log_file is console, default is falsedisable_log_color = false# max ports can be used for each client, default value is 0 means no limitmax_ports_per_client = 0# if tcp stream multiplexing is used, default is truetcp_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 greproot 3600 0.1 0.1 110188 9484 pts/0 Sl 15:04 0:00 ./frpc -c ./frpc.ini
kill
$ kill -9 3600

