TLS ECH: Handle "h2c://" query correctly (#6261)

Fixes https://github.com/XTLS/Xray-core/issues/6259#issuecomment-4614984919

---------

Co-authored-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com>
This commit is contained in:
风扇滑翔翼
2026-06-09 17:03:24 +08:00
committed by GitHub
parent 83cf229909
commit a0e9347f1b
+3
View File
@@ -234,6 +234,9 @@ func dnsQuery(server string, domain string, sockopt *internet.SocketConfig) ([]b
if err != nil {
return nil, 0, err
}
// h2c: in config is just for claim
// change scheme to https and expect outbound to handle TLS (freedom + tlsSetting)
req.URL.Scheme = "https"
req.Header.Set("Accept", "application/dns-message")
req.Header.Set("Content-Type", "application/dns-message")
utils.TryDefaultHeadersWith(req.Header, "fetch")