mirror of
https://github.com/netchx/netch.git
synced 2026-03-28 18:59:46 +08:00
feat: Mode.SupportSocks5Auth
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user