GitHub:https://github.com/fatedier/frp/releases
树莓派下载:arm
配置
1.服务器frps.ini
[common] #本机绑定ip bind_addr = 0.0.0.0 #与客户端绑定的进行通信的端口 bind_port = 8120 bind_udp_port = 8121 kcp_bind_port = 8122 #访问客户端web服务自定义的端口号 vhost_http_port = 8123 vhost_https_port = 8124 subdomain_host = test.com dashboard_addr = 0.0.0.0 dashboard_port = 8125 dashboard_user = user dashboard_pwd = pwd token = 123456 max_pool_count = 100 log_file = ../log/frps.log log_level = info log_max_days = 3
2.客户端frpc.ini
[common] #公网服务器ip server_addr = test.com #与服务端绑定的进行通信的端口 server_port = 8120 token = 123456 user = user [web] #访问协议 type = http local_ip = 127.0.0.1 #内网web服务的端口号 local_port = 80 #所绑定的公网服务器域名,user.test.com subdomain = user [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6001
启动脚本:
./frps -c ./frps.ini
./frpc -c ./frpc.ini
使用:
user.test.com,访问客户端的80端口
ssh -oPort=6001 test@test.com (test为电脑用户名,非客户端用户名)
缺陷:
对于服务端来说,用户可以随意修改端口,域名