From 5836f36f69bc4253ef96336d0c129b7f4b99ad2a Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Sun, 18 Jan 2026 04:17:25 +0000 Subject: [PATCH] Config: Add Warning for deprecated features (allowInsecure, Shadowsocks, VMess, Trojan, VLESS without flow) Accelerate! --- infra/conf/shadowsocks.go | 6 +++++- infra/conf/transport_internet.go | 3 +++ infra/conf/trojan.go | 6 +++++- infra/conf/vless.go | 11 ++++++----- infra/conf/vmess.go | 8 ++++++-- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/infra/conf/shadowsocks.go b/infra/conf/shadowsocks.go index 4a04d977..3163798d 100644 --- a/infra/conf/shadowsocks.go +++ b/infra/conf/shadowsocks.go @@ -50,6 +50,8 @@ type ShadowsocksServerConfig struct { } func (v *ShadowsocksServerConfig) Build() (proto.Message, error) { + errors.PrintDeprecatedFeatureWarning("Shadowsocks", "VLESS Encryption") + if C.Contains(shadowaead_2022.List, v.Cipher) { return buildShadowsocks2022(v) } @@ -185,6 +187,8 @@ type ShadowsocksClientConfig struct { } func (v *ShadowsocksClientConfig) Build() (proto.Message, error) { + errors.PrintDeprecatedFeatureWarning("Shadowsocks", "VLESS Encryption") + if v.Address != nil { v.Servers = []*ShadowsocksServerTarget{ { @@ -255,7 +259,7 @@ func (v *ShadowsocksClientConfig) Build() (proto.Message, error) { ss := &protocol.ServerEndpoint{ Address: server.Address.Build(), Port: uint32(server.Port), - User: &protocol.User{ + User: &protocol.User{ Level: uint32(server.Level), Email: server.Email, Account: serial.ToTypedMessage(account), diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index ca7f866f..e24f0688 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -596,6 +596,9 @@ func (c *TLSConfig) Build() (proto.Message, error) { } serverName := c.ServerName config.AllowInsecure = c.Insecure + if config.AllowInsecure { + errors.PrintDeprecatedFeatureWarning("allowInsecure", "pinnedPeerCertSha256") + } if len(c.ServerName) > 0 { config.ServerName = serverName } diff --git a/infra/conf/trojan.go b/infra/conf/trojan.go index d9907019..885504cc 100644 --- a/infra/conf/trojan.go +++ b/infra/conf/trojan.go @@ -39,6 +39,8 @@ type TrojanClientConfig struct { // Build implements Buildable func (c *TrojanClientConfig) Build() (proto.Message, error) { + errors.PrintDeprecatedFeatureWarning("Trojan", "VLESS with flow") + if c.Address != nil { c.Servers = []*TrojanServerTarget{ { @@ -74,7 +76,7 @@ func (c *TrojanClientConfig) Build() (proto.Message, error) { config.Server = &protocol.ServerEndpoint{ Address: rec.Address.Build(), Port: uint32(rec.Port), - User: &protocol.User{ + User: &protocol.User{ Level: uint32(rec.Level), Email: rec.Email, Account: serial.ToTypedMessage(&trojan.Account{ @@ -115,6 +117,8 @@ type TrojanServerConfig struct { // Build implements Buildable func (c *TrojanServerConfig) Build() (proto.Message, error) { + errors.PrintDeprecatedFeatureWarning("Trojan", "VLESS with flow") + config := &trojan.ServerConfig{ Users: make([]*protocol.User, len(c.Clients)), } diff --git a/infra/conf/vless.go b/infra/conf/vless.go index f482c4d8..8a03eaab 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -42,8 +42,6 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) { config := new(inbound.Config) config.Clients = make([]*protocol.User, len(c.Clients)) switch c.Flow { - case vless.None: - c.Flow = "" case "", vless.XRV: default: return nil, errors.New(`VLESS "settings.flow" doesn't support "` + c.Flow + `" in this version`) @@ -67,12 +65,13 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) { switch account.Flow { case "": account.Flow = c.Flow - case vless.None: - account.Flow = "" case vless.XRV: default: return nil, errors.New(`VLESS clients: "flow" doesn't support "` + account.Flow + `" in this version`) } + if account.Flow == "" { + errors.PrintDeprecatedFeatureWarning("VLESS without flow", "VLESS with flow") + } if len(account.Testseed) < 4 { account.Testseed = c.Testseed @@ -280,7 +279,9 @@ func (c *VLessOutboundConfig) Build() (proto.Message, error) { account.Id = u.String() switch account.Flow { - case "", vless.XRV, vless.XRV + "-udp443": + case "": + errors.PrintDeprecatedFeatureWarning("VLESS without flow", "VLESS with flow") + case vless.XRV, vless.XRV + "-udp443": default: return nil, errors.New(`VLESS users: "flow" doesn't support "` + account.Flow + `" in this version`) } diff --git a/infra/conf/vmess.go b/infra/conf/vmess.go index 4db061de..98c85b43 100644 --- a/infra/conf/vmess.go +++ b/infra/conf/vmess.go @@ -58,12 +58,14 @@ func (c *VMessDefaultConfig) Build() *inbound.DefaultConfig { } type VMessInboundConfig struct { - Users []json.RawMessage `json:"clients"` - Defaults *VMessDefaultConfig `json:"default"` + Users []json.RawMessage `json:"clients"` + Defaults *VMessDefaultConfig `json:"default"` } // Build implements Buildable func (c *VMessInboundConfig) Build() (proto.Message, error) { + errors.PrintDeprecatedFeatureWarning("VMess", "VLESS Encryption") + config := &inbound.Config{} if c.Defaults != nil { @@ -113,6 +115,8 @@ type VMessOutboundConfig struct { // Build implements Buildable func (c *VMessOutboundConfig) Build() (proto.Message, error) { + errors.PrintDeprecatedFeatureWarning("VMess", "VLESS Encryption") + config := new(outbound.Config) if c.Address != nil { c.Receivers = []*VMessOutboundTarget{