frps使用https协议

2020-11-25 09:45:35 阅读:2 编辑

frps.ini

[common]
bind_port = 5001
vhost_http_port=5002
vhost_https_port=5003
subdomain_host = go.xmyunce.com
dashboard_port = 7500
# dashboard's username and password are both optional拢卢if not set, default is admin.
dashboard_user = admin
dashboard_pwd = admin123
[plugin.multiuser]
addr = 127.0.0.1:7200
path = /handler
ops = Login

frpc.ini

[common]
server_addr = go.xmyunce.com
server_port = 5001
user = user12
meta_token = 1234

[walterlv_example_http]
# 依然支持 http 访问
type = http
# 本地 Web 服务的端口
local_port = 12345
# 需要反向代理的域名(当访客通过此域名访问 A 机器时,才会将请求反向代理到此 Web 服务)
subdomain = lin
[walterlv_example]
# 配置 https 访问
type = https
# 本地 Web 服务的端口(与前面的配置一样,都对应同一个 Web 服务)
local_port = 12345
# 需要反向代理的域名(当访客通过此域名访问 A 机器时,才会将请求反向代理到此 Web 服务)
subdomain = lin

# 接下来的配置是支持 https 的重点配置
# 配置插件,将 https 请求转换成 http 请求后再发送给本地 Web 服务程序
plugin = https2http
# 转换成 http 后,发送到本机的 10000 端口
plugin_local_addr = 127.0.0.1:12345
# 可能是 frp 的 Bug?这里必须写成 127.0.0.1,稍后解释
plugin_host_header_rewrite = 127.0.0.1
# 指定代理方式为 frp
plugin_header_X-From-Where = frp
# 指定成你在前面部分导出的证书的路径
plugin_crt_path = ./4822340_lin.go.xmyunce.com.pem
plugin_key_path = ./4822340_lin.go.xmyunce.com.key