Skip to content
This repository was archived by the owner on Aug 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions app/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
Loading