using System.Collections.Generic;
using Netch.Models;
namespace Netch.Servers.VMess
{
public class VMess : Server
{
private string _tlsSecureType = VMessGlobal.TLSSecure[0];
public VMess()
{
Type = "VMess";
}
///
/// 用户 ID
///
public string UserID { get; set; }
///
/// 额外 ID
///
public int AlterID { get; set; }
///
/// 加密方式
///
public virtual string EncryptMethod { get; set; } = VMessGlobal.EncryptMethods[0];
///
/// 传输协议
///
public virtual string TransferProtocol { get; set; } = VMessGlobal.TransferProtocols[0];
///
/// 伪装类型
///
public virtual string FakeType { get; set; } = VMessGlobal.FakeTypes[0];
///
/// 伪装域名
///
public string Host { get; set; }
///
/// 传输路径
///
public string Path { get; set; }
///
/// QUIC 加密方式
///
public string QUICSecure { get; set; } = VMessGlobal.QUIC[0];
///
/// QUIC 加密密钥
///
public string QUICSecret { get; set; } = string.Empty;
///
/// TLS 底层传输安全
///
public string TLSSecureType
{
get => _tlsSecureType;
set
{
if (value == "")
value = "none";
_tlsSecureType = value;
}
}
///
/// Mux 多路复用
///
public bool? UseMux { get; set; } = false;
}
public class VMessGlobal
{
public static readonly List EncryptMethods = new()
{
"auto",
"none",
"aes-128-gcm",
"chacha20-poly1305"
};
public static readonly List QUIC = new()
{
"none",
"aes-128-gcm",
"chacha20-poly1305"
};
///
/// V2Ray 传输协议
///
public static readonly List TransferProtocols = new()
{
"tcp",
"kcp",
"ws",
"h2",
"quic"
};
///
/// V2Ray 伪装类型
///
public static readonly List FakeTypes = new()
{
"none",
"http",
"srtp",
"utp",
"wechat-video",
"dtls",
"wireguard"
};
///
/// TLS 安全类型
///
public static readonly List TLSSecure = new()
{
"none",
"tls"
};
}
}