From 2bbc722036c98b2057e53273d52f5dfff9ac1ba4 Mon Sep 17 00:00:00 2001 From: api-me <225520420+api-me@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:46:42 +0800 Subject: [PATCH 1/2] feat: add FakeTCP Option for XLESS App --- app/cmd/server.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 { From 9229b9a79eb0339c48cb60c1cafbe10ed8d1b670 Mon Sep 17 00:00:00 2001 From: api-me <225520420+api-me@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:49:19 +0800 Subject: [PATCH 2/2] Update client.go --- app/cmd/client.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 {