SOCKS : Support version 4 & 4a

This commit is contained in:
Hellojack
2022-06-10 11:00:57 +08:00
committed by GitHub
parent 406135b04b
commit bedafc23d4
6 changed files with 32 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ namespace Netch.Servers;
public class Socks5Server : Server
{
public override string Type { get; } = "Socks5";
public override string Type { get; } = "SOCKS";
/// <summary>
/// 密码
@@ -18,6 +18,11 @@ public class Socks5Server : Server
public string? RemoteHostname { get; set; }
/// <summary>
/// 版本
/// </summary>
public string Version { get; set; } = SOCKSGlobal.Versions[0];
public override string MaskedData()
{
return $"Auth: {Auth()}";
@@ -48,4 +53,14 @@ public class Socks5Server : Server
{
return !string.IsNullOrWhiteSpace(Username) && !string.IsNullOrWhiteSpace(Password);
}
}
public class SOCKSGlobal
{
public static readonly List<string> Versions = new()
{
"5",
"4a",
"4"
};
}