feat: Mode.SupportSocks5Auth

This commit is contained in:
ChsBuffer
2020-10-13 09:45:30 +08:00
parent 2d95d8b257
commit 79b6e5da43
2 changed files with 10 additions and 2 deletions

View File

@@ -33,6 +33,12 @@ namespace Netch.Models
/// </summary>
public int Type = 0;
public bool SupportSocks5Auth => Type switch
{
0 => false,
_ => false
};
/// <summary>
/// 绕过中国0. 不绕过 1. 绕过)
/// </summary>
@@ -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");
}

View File

@@ -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"))