mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-15 15:58:41 +00:00
XHTTP client: Add gRPC header to "stream-up" mode by default (#4042)
""Breaking"": Client uses "stream-up" mode by default when using **TLS H2** or REALITY
This commit is contained in:
parent
0a252ac15d
commit
817fa72874
5 changed files with 62 additions and 41 deletions
|
@ -312,9 +312,13 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|||
}
|
||||
|
||||
mode := transportConfiguration.Mode
|
||||
if mode == "auto" && realityConfig != nil {
|
||||
mode = "stream-up"
|
||||
if mode == "auto" {
|
||||
mode = "packet-up"
|
||||
if (tlsConfig != nil && len(tlsConfig.NextProtocol) != 1) || realityConfig != nil {
|
||||
mode = "stream-up"
|
||||
}
|
||||
}
|
||||
errors.LogInfo(ctx, "XHTTP is using mode: "+mode)
|
||||
if mode == "stream-up" {
|
||||
conn.writer = httpClient.OpenUpload(ctx, requestURL.String())
|
||||
return stat.Connection(&conn), nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue