HTTP/HTTPS穿透配置
HTTP穿透
HTTP穿透是FRP最基本的功能之一,适用于Web应用、API等HTTP服务。
客户端配置示例:
[web]
type = http
local_ip = 127.0.0.1
local_port = 80
custom_domains = www.example.com
HTTPS穿透
HTTPS穿透有两种方式:
方式一:frps配置SSL证书
[common]
bind_port = 7000
vhost_https_port = 443
tls_cert_file = /path/to/cert.pem
tls_key_file = /path/to/key.pem
方式二:本地Web服务配置SSL
[web]
type = https
local_ip = 127.0.0.1
local_port = 443
custom_domains = www.example.com
域名复用
通过不同的子域名或URL路径区分多个服务:
[web1]
type = http
local_port = 8080
custom_domains = web.example.com
[web2]
type = http
local_port = 8081
custom_domains = api.example.com