mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 19:39:35 +03:00
XHTTP: Add "stream-up" mode for client & server (#3994)
This commit is contained in:
@ -233,6 +233,7 @@ type SplitHTTPConfig struct {
|
||||
XPaddingBytes *Int32Range `json:"xPaddingBytes"`
|
||||
Xmux Xmux `json:"xmux"`
|
||||
DownloadSettings *StreamConfig `json:"downloadSettings"`
|
||||
Mode string `json:"mode"`
|
||||
}
|
||||
|
||||
type Xmux struct {
|
||||
@ -289,6 +290,14 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
|
||||
muxProtobuf.CMaxReuseTimes.To = 128
|
||||
}
|
||||
|
||||
switch c.Mode {
|
||||
case "":
|
||||
c.Mode = "auto"
|
||||
case "auto", "packet-up", "stream-up":
|
||||
default:
|
||||
return nil, errors.New("unsupported mode: " + c.Mode)
|
||||
}
|
||||
|
||||
config := &splithttp.Config{
|
||||
Path: c.Path,
|
||||
Host: c.Host,
|
||||
@ -299,6 +308,7 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
|
||||
NoSSEHeader: c.NoSSEHeader,
|
||||
XPaddingBytes: splithttpNewRandRangeConfig(c.XPaddingBytes),
|
||||
Xmux: &muxProtobuf,
|
||||
Mode: c.Mode,
|
||||
}
|
||||
var err error
|
||||
if c.DownloadSettings != nil {
|
||||
|
Reference in New Issue
Block a user