mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-03 18:28:52 +00:00
fix: restrict xhttp browser dialer mode and remove added tests
Agent-Logs-Url: https://github.com/XTLS/Xray-core/sessions/071df77b-69fb-4b1f-a14d-9dab447e1efa Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a54c54a559
commit
5906445c68
@@ -1980,6 +1980,22 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
|
||||
if strings.EqualFold(c.Security, "reality") {
|
||||
return nil, errors.New("sockopt.browserDialer does not support REALITY")
|
||||
}
|
||||
if config.ProtocolName == "splithttp" {
|
||||
splitHTTPSettings := c.SplitHTTPSettings
|
||||
if c.XHTTPSettings != nil {
|
||||
splitHTTPSettings = c.XHTTPSettings
|
||||
}
|
||||
if splitHTTPSettings != nil {
|
||||
splitHTTPSettingsCopy := *splitHTTPSettings
|
||||
hs, err := splitHTTPSettingsCopy.Build()
|
||||
if err != nil {
|
||||
return nil, errors.New("Failed to build XHTTP config.").Base(err)
|
||||
}
|
||||
if splitHTTPConfig, ok := hs.(*splithttp.Config); ok && splitHTTPConfig.Mode != "auto" && splitHTTPConfig.Mode != "packet-up" {
|
||||
return nil, errors.New("sockopt.browserDialer only supports XHTTP mode auto or packet-up")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch strings.ToLower(c.Security) {
|
||||
|
||||
Reference in New Issue
Block a user