Appearance
下载安装
github搜索frp star最多的项目,到release中根据系统下载响应压缩包 传送门, 压缩包中包含frps(公网服务端),frpc(需要被穿透的客户端).ini 结尾是配置文件,full.ini 是全部的配置文件
启动服务端和客户端
./fprs -c ./frps.ini // 到公网服务器启动
./frpc -c ./frpc.ini // 需要被穿透的机器上执行
服务器配置
官网文档支持中文,更多细节查看官方文档
[common]
# 通信端口
bind_port = 7000
# 外网访问端口
vhost_http_port=80
vhost_https_port=443
# 二级域名
subdomain_host=frp.xunserver.cn
# 连接密码
token=adadadadad
# 管理服务器 密码用户端口
dashboard_port=7500
dashboard_user=admin
dashboard_pwd=adadadadad
# 连接池
# max_pool_count=5
客户端管理
[common]
# 服务器地址
server_addr = xx.xx.xx.xx
# 服务器配置中 bind_port 字段
server_port = 7000
# 本地管理
admin_addr = 127.0.0.1
admin_port = 7400
admin_user = admin
admin_passwd = admin
# 连接密码
token=xxxxx
# 连接池
pool_count = 5
# 日志
log_file = ./frpc.log
# 客户端名字,必须和其他客户端名字不同
[migu-http]
type = http # 类型
local_port = 80 # 映射到本地端口
subdomain= migu # 子域名
# 同上
[migu-https]
type = https
local_port = 443
subdomain= migu
https 配置
由于frp 是全部转发,所以https的配置在应用上,可以在nginx上配置。具体参考 nginx-https配置
ssh 连接
在客户端配置, 执行==ssh -oPort=6000 username@x.x.x.x==
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
