赞
踩
crt/key
格式证书
前往 Frp Github Releases 页面下载对应的压缩包:
客户端amd64的windows系统,服务器也是amd64架构。
使用wget下载对应的压缩包
wget https://github.com/fatedier/frp/releases/download/v0.53.2/frp_0.53.2_linux_amd64.tar.gz
tar -zxvf frp_0.53.2_linux_amd64.tar.gz
cd frp_0.53.2_linux_amd64
vim frps.toml
编辑 frps.toml
bindPort = 7000
vhostHTTPSPort = 443
auth.token = "passwordAuthToken" # 更改为自己的密码,用于客户端与服务端连接的密钥
webServer.addr = "0.0.0.0"
# 服务端web管理页面端口以及账号密码
webServer.port = 7500
webServer.user = "admin"
webServer.password = "admin"
运行
./frps -c frps.toml
可以访问 http://server-ip:7500 登录管理面板 账号密码均为设置 admin
解压下载好的 frp_0.53.2_windows_amd64.zip
cd frp_0.53.2_windows_amd64
mkdir ssl
cd ssl
mkdir domain1.example.com
mkdir domain2.example.com
mkdir domain3.example.com
将下载好的 SSL 证书下载,放到 ssl 文件夹对应的域名文件夹下
以阿里云域名SSL证书为例,下载下来的 crt/key 证书如图:
内网服务域名穿透对应如下
domain1.example.com --> 127.0.0.1:3000
domain2.example.com --> 127.0.0.1:4000
domain3.example.com --> 192.168.0.93:5000 # 局域网web服务,非本机服务
编辑 frpc.toml
serverAddr = "server-ip" serverPort = 7000 auth.token = "passwordAuthToken" # 客户端管理面板 webServer.addr = "127.0.0.1" webServer.port = 7400 webServer.user = "admin" webServer.password = "admin" [[proxies]] name = "domain1_https" # 名称,随意填,与后面的name不可重复 type = "https" customDomains = ["domain1.example.com"] # 需要指向的域名,后面运行后使用这个域名访问 [proxies.plugin] type = "https2http" localAddr = "127.0.0.1:3000" # 需要穿透的本地web服务 crtPath = "./ssl/domain1.example.com/domain1.example.com_public.crt" # 对应域名的 crt 证书 keyPath = "./ssl/domain1.example.com/domain1.example.com.key" # 对应域名的 key 证书 hostHeaderRewrite = "127.0.0.1" # 与 localAddr 的 ip 对应即可 requestHeaders.set.x-from-where = "frp" [[proxies]] name = "domain2_https" type = "https" customDomains = ["domain2.example.com"] [proxies.plugin] type = "https2http" localAddr = "127.0.0.1:4000" crtPath = "./ssl/domain2.example.com/domain2.example.com_public.crt" keyPath = "./ssl/domain2.example.com/domain2.example.com.key" hostHeaderRewrite = "127.0.0.1" requestHeaders.set.x-from-where = "frp" [[proxies]] name = "domain3_https" type = "https" customDomains = ["domain3.example.com"] [proxies.plugin] type = "https2http" localAddr = "192.168.0.93:5000" # 局域网 web 服务 crtPath = "./ssl/domain3.example.com/domain3.example.com_public.crt" keyPath = "./ssl/domain3.example.com/domain3.example.com.key" hostHeaderRewrite = "192.168.0.93" requestHeaders.set.x-from-where = "frp"
运行
./frpc.exe -c frpc.toml
浏览器输入 https://domain1.example.com 即可使用https协议正常访问
我的博客,欢迎前往: https://blog.ivwv.site/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。