mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
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:
parent
4ce65fc74c
commit
369d8944cf
7 changed files with 39 additions and 59 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue