mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-16 13:27:16 +03:00
Add SplitHTTP Transport (#3412)
This commit is contained in:
@ -16,6 +16,7 @@ type TransportConfig struct {
|
||||
GRPCConfig *GRPCConfig `json:"grpcSettings"`
|
||||
GUNConfig *GRPCConfig `json:"gunSettings"`
|
||||
HTTPUPGRADEConfig *HttpUpgradeConfig `json:"httpupgradeSettings"`
|
||||
SplitHTTPConfig *SplitHTTPConfig `json:"splithttpSettings"`
|
||||
}
|
||||
|
||||
// Build implements Buildable.
|
||||
@ -113,5 +114,16 @@ func (c *TransportConfig) Build() (*global.Config, error) {
|
||||
})
|
||||
}
|
||||
|
||||
if c.SplitHTTPConfig != nil {
|
||||
shs, err := c.SplitHTTPConfig.Build()
|
||||
if err != nil {
|
||||
return nil, newError("failed to build SplitHTTP config").Base(err)
|
||||
}
|
||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
||||
ProtocolName: "splithttp",
|
||||
Settings: serial.ToTypedMessage(shs),
|
||||
})
|
||||
}
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user