using Netch.Models;
namespace Netch.Servers;
public class ShadowsocksServer : Server
{
public override string Type { get; } = "SS";
public override string MaskedData()
{
return $"{EncryptMethod} + {Plugin}";
}
///
/// 加密方式
///
public string EncryptMethod { get; set; } = SSGlobal.EncryptMethods[4];
///
/// 密码
///
public string Password { get; set; } = string.Empty;
///
/// 插件
///
public string? Plugin { get; set; }
///
/// 插件参数
///
public string? PluginOption { get; set; }
public bool HasPlugin()
{
return !string.IsNullOrWhiteSpace(Plugin) && !string.IsNullOrWhiteSpace(PluginOption);
}
}
public static class SSGlobal
{
///
/// SS 加密列表
///
public static readonly List EncryptMethods = new()
{
"none",
// 2022 edition cipher
"2022-blake3-aes-128-gcm",
"2022-blake3-aes-256-gcm",
"2022-blake3-chacha20-poly1305",
// AEAD cipher
"aes-128-gcm",
"aes-192-gcm",
"aes-256-gcm",
"chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305",
// stream cipher
"rc4",
"rc4-md5",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-cfb8",
"aes-192-cfb8",
"aes-256-cfb8",
"aes-128-ofb",
"aes-192-ofb",
"aes-256-ofb",
"bf-cfb",
"cast5-cfb",
"des-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"camellia-128-cfb8",
"camellia-192-cfb8",
"camellia-256-cfb8",
"salsa20",
"chacha20",
"chacha20-ietf",
"xchacha20"
};
}