fatedier / frp

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
Apache License 2.0
85.32k stars 13.23k forks source link

Frp https proxy fail #4442

Closed kun-guo closed 3 weeks ago

kun-guo commented 4 weeks ago

Bug Description

frp https proxy failed, cause: [vhost/vhost.go:218] http request for host [] path [] httpUser [] not found frp server log: 截屏2024-09-15 15 10 55

dashboard 截屏2024-09-15 15 17 38

frpc Version

0.59.0

frps Version

0.60.0

System Architecture

linux/amd64

Configurations

# frps.toml
bindPort = 20000                            
auth.token = "token value"       
vhostHTTPSPort =443

# Server Dashboard,可以查看frp服务状态以及统计信息
webServer.addr = "0.0.0.0"      # 后台管理地址
webServer.port = 7001             # 后台管理端口
webServer.user = "admin"          # 后台登录用户名
webServer.password = "password" # 后台登录密码
# frpc.toml
serverAddr = "118.92.19.12"
serverPort = 20000
auth.token = "xxxxx"
log.level = "debug"

# https
[[proxies]]
name = "my-https"
type = "https"
customDomains = ["118.92.19.12"]

[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:80"

# HTTPS 证书相关的配置
crtPath = "/etc/frp/certs/server.crt"
keyPath = "/etc/frp/certs/server.key"
hostHeaderRewrite = "127.0.0.1"
requestHeaders.set.x-from-where = "frp"

SSL 证书使用公网 IP 自签名证书

Logs

No response

Steps to reproduce

No response

Affected area

Jianfei-DinG commented 4 weeks ago

你这个能正常链接吗?# frpc.toml serverAddr = "118.92.19.12" serverPort = 20000 auth.token = "xxxxx" log.level = "debug"

我用这种serverAddr 就连接不上

xqzr commented 4 weeks ago

不支持。 type = "https" 需要读取 SNI

superzjg commented 4 weeks ago

是不是 vhostHTTPSPort =443 的问题,换个端口号试试,国内很多时候443用不了,被限制。

fatedier commented 3 weeks ago

In general, please use the domain name to access https.