mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
XHTTP: Add "stream-one" mode for client & server (#4071)
""Breaking"": Client uses "stream-one" mode by default when using **REALITY** ("stream-up" if "downloadSettings" exists)
This commit is contained in:
parent
d8934cf839
commit
f7bd98b13c
5 changed files with 141 additions and 25 deletions
|
@ -307,7 +307,7 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
|
|||
switch c.Mode {
|
||||
case "":
|
||||
c.Mode = "auto"
|
||||
case "auto", "packet-up", "stream-up":
|
||||
case "auto", "packet-up", "stream-up", "stream-one":
|
||||
default:
|
||||
return nil, errors.New("unsupported mode: " + c.Mode)
|
||||
}
|
||||
|
@ -327,6 +327,9 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
|
|||
}
|
||||
var err error
|
||||
if c.DownloadSettings != nil {
|
||||
if c.Mode == "stream-one" {
|
||||
return nil, errors.New(`Can not use "downloadSettings" in "stream-one" mode.`)
|
||||
}
|
||||
if c.Extra != nil {
|
||||
c.DownloadSettings.SocketSettings = nil
|
||||
}
|
||||
|
@ -707,8 +710,10 @@ func (p TransportProtocol) Build() (string, error) {
|
|||
case "ws", "websocket":
|
||||
return "websocket", nil
|
||||
case "h2", "h3", "http":
|
||||
errors.PrintDeprecatedFeatureWarning("HTTP transport", "XHTTP transport")
|
||||
return "http", nil
|
||||
case "grpc":
|
||||
errors.PrintMigrateFeatureInfo("gRPC transport", "XHTTP transport")
|
||||
return "grpc", nil
|
||||
case "httpupgrade":
|
||||
return "httpupgrade", nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue