mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +08:00
SOCKS : Support version 4 & 4a
This commit is contained in:
@@ -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"
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user