Refactor Server.Type

This commit is contained in:
ChsBuffer
2021-02-26 14:16:41 +08:00
parent fde71e922f
commit e0ca3a5ee4
7 changed files with 14 additions and 31 deletions

View File

@@ -11,36 +11,37 @@ namespace Netch.Models
/// 延迟
/// </summary>
[JsonIgnore]
public int Delay = -1;
public int Delay { get; private set; } = -1;
/// <summary>
/// 组
/// </summary>
public string Group = "None";
public string Group { get; set; } = "None";
/// <summary>
/// 地址
/// </summary>
public string Hostname;
public string Hostname { get; set; }
/// <summary>
/// 端口
/// </summary>
public ushort Port;
public ushort Port { get; set; }
/// <summary>
/// 倍率
/// </summary>
public double Rate = 1.0;
public double Rate { get; } = 1.0;
/// <summary>
/// 备注
/// </summary>
public string Remark;
public string Remark { get; set; }
/// <summary>
/// 代理类型
/// </summary>
public string Type;
public virtual string Type { get; } = "WTF";
public object Clone()
{

View File

@@ -5,10 +5,7 @@ namespace Netch.Servers.Shadowsocks
{
public class Shadowsocks : Server
{
public Shadowsocks()
{
Type = "SS";
}
public override string Type { get; } = "SS";
/// <summary>
/// 加密方式

View File

@@ -5,10 +5,7 @@ namespace Netch.Servers.ShadowsocksR
{
public class ShadowsocksR : Server
{
public ShadowsocksR()
{
Type = "SSR";
}
public override string Type { get; } = "SSR";
/// <summary>
/// 加密方式

View File

@@ -14,10 +14,7 @@ namespace Netch.Servers.Socks5
/// </summary>
public string Username;
public Socks5()
{
Type = "Socks5";
}
public override string Type { get; } = "Socks5";
public bool Auth()
{

View File

@@ -4,10 +4,7 @@ namespace Netch.Servers.Trojan
{
public class Trojan : Server
{
public Trojan()
{
Type = "Trojan";
}
public override string Type { get; } = "Trojan";
/// <summary>
/// 密码

View File

@@ -5,10 +5,7 @@ namespace Netch.Servers.VLESS
{
public class VLESS : VMess.VMess
{
public VLESS()
{
Type = "VLESS";
}
public override string Type { get; } = "VLESS";
/// <summary>
/// 加密方式

View File

@@ -7,10 +7,7 @@ namespace Netch.Servers.VMess
{
private string _tlsSecureType = VMessGlobal.TLSSecure[0];
public VMess()
{
Type = "VMess";
}
public override string Type { get; } = "VMess";
/// <summary>
/// 用户 ID