Sockopt config: Add penetrate for XHTTP U-D-S, Remove tcpNoDelay

Now `sockopt` can be shared via `extra`, and be replaced with upload's forcibly.

Closes https://github.com/XTLS/Xray-core/issues/4227
This commit is contained in:
RPRX 2024-12-31 11:10:17 +00:00 committed by GitHub
parent 4ce65fc74c
commit 369d8944cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 39 additions and 59 deletions

View file

@ -262,7 +262,6 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
extra.Host = c.Host
extra.Path = c.Path
extra.Mode = c.Mode
extra.Extra = c.Extra
c = &extra
}
@ -318,9 +317,6 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
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
}
var err error
if config.DownloadSettings, err = c.DownloadSettings.Build(); err != nil {
return nil, errors.New(`Failed to build "downloadSettings".`).Base(err)
@ -689,7 +685,7 @@ type SocketConfig struct {
TCPCongestion string `json:"tcpCongestion"`
TCPWindowClamp int32 `json:"tcpWindowClamp"`
TCPMaxSeg int32 `json:"tcpMaxSeg"`
TcpNoDelay bool `json:"tcpNoDelay"`
Penetrate bool `json:"penetrate"`
TCPUserTimeout int32 `json:"tcpUserTimeout"`
V6only bool `json:"v6only"`
Interface string `json:"interface"`
@ -776,7 +772,7 @@ func (c *SocketConfig) Build() (*internet.SocketConfig, error) {
TcpCongestion: c.TCPCongestion,
TcpWindowClamp: c.TCPWindowClamp,
TcpMaxSeg: c.TCPMaxSeg,
TcpNoDelay: c.TcpNoDelay,
Penetrate: c.Penetrate,
TcpUserTimeout: c.TCPUserTimeout,
V6Only: c.V6only,
Interface: c.Interface,