diff --git a/Netch/Models/Mode.cs b/Netch/Models/Mode.cs index 9f081164..b17c2c98 100644 --- a/Netch/Models/Mode.cs +++ b/Netch/Models/Mode.cs @@ -33,6 +33,12 @@ namespace Netch.Models /// public int Type = 0; + public bool SupportSocks5Auth => Type switch + { + 0 => false, + _ => false + }; + /// /// 绕过中国(0. 不绕过 1. 绕过) /// @@ -67,7 +73,8 @@ namespace Netch.Models if (mode == null) { Logging.Warning($"{relativePath} file included in {Remark} not found"); - }else if (mode == this) + } + else if (mode == this) { Logging.Warning("Can't self-reference"); } diff --git a/Netch/Servers/Socks5/S5Controller.cs b/Netch/Servers/Socks5/S5Controller.cs index 3b56b234..44ce714f 100644 --- a/Netch/Servers/Socks5/S5Controller.cs +++ b/Netch/Servers/Socks5/S5Controller.cs @@ -12,7 +12,8 @@ namespace Netch.Servers.Socks5 public bool Start(Server s, Mode mode) { - if (((Socks5) s).Auth()) + var server = (Socks5) s; + if (server.Auth() && !mode.SupportSocks5Auth) { File.WriteAllText("data\\last.json", V2rayConfigUtils.GenerateClientConfig(s, mode)); if (StartInstanceAuto("-config ..\\data\\last.json"))