diff --git a/app/cmd/client.go b/app/cmd/client.go index e556e55..2ecff7d 100644 --- a/app/cmd/client.go +++ b/app/cmd/client.go @@ -81,6 +81,7 @@ type clientConfig struct { UQUICSpecID quic.QUICID `mapstructure:"uquicSpecID"` // 从 clientConfigQUIC 移到这里 Protocol string `mapstructure:"protocol"` ProtocolParam string `mapstructure:"protocolParam"` + XLESSUseFakeTCP bool `mapstructure:"xlessUseFakeTCP"` } type clientConfigTransportUDP struct { @@ -462,6 +463,7 @@ func (c *clientConfig) Config() (*client.Config, error) { c.fillDecoyURL, c.fillUQUICConfig, // 新增 c.fillProtocolConfig, // <<< 新增这一行 + c.fillXLESSUseFakeTCP, // 新增 } for _, f := range fillers { if err := f(hyConfig); err != nil { @@ -885,6 +887,12 @@ func (c *clientConfig) fillDecoyURL(hyConfig *client.Config) error { return nil } +// 2. 增加 fillXLESSUseFakeTCP 方法 +func (c *clientConfig) fillXLESSUseFakeTCP(hyConfig *client.Config) error { + hyConfig.XLESSUseFakeTCP = c.XLESSUseFakeTCP + return nil +} + // isPortHoppingPort returns whether the port string is a port hopping port. // We consider a port string to be a port hopping port if it contains "-" or ",". func isPortHoppingPort(port string) bool { diff --git a/app/cmd/server.go b/app/cmd/server.go index 7a30a67..cb3c511 100644 --- a/app/cmd/server.go +++ b/app/cmd/server.go @@ -79,6 +79,7 @@ type serverConfig struct { UQUICSpecID quic.QUICID `mapstructure:"uquicSpecID"` // 从 serverConfigQUIC 移到这里 Protocol string `mapstructure:"protocol"` ProtocolParam string `mapstructure:"protocolParam"` + XLESSUseFakeTCP bool `mapstructure:"xlessUseFakeTCP"` } // serverConfigObfs struct now directly embeds obfs.ObfuscatorConfig @@ -298,6 +299,12 @@ func (c *serverConfig) fillUQUICConfig(hyConfig *server.Config) error { return nil } +// 2. 增加 fillXLESSUseFakeTCP 方法 +func (c *serverConfig) fillXLESSUseFakeTCP(hyConfig *server.Config) error { + hyConfig.XLESSUseFakeTCP = c.XLESSUseFakeTCP + return nil +} + func (c *serverConfig) fillTLSConfig(hyConfig *server.Config) error { // If both TLS and ACME are unset, fallback to protean mimic cert if c.TLS == nil && c.ACME == nil { @@ -1058,6 +1065,7 @@ func (c *serverConfig) Config() (*server.Config, error) { c.fillDecoyURL, c.fillUQUICConfig, // 保持不变 c.fillProtocolConfig, // <<< 新增这一行 + c.fillXLESSUseFakeTCP, // 新增 } for _, f := range fillers { if err := f(hyConfig); err != nil {