mirror of
https://github.com/netchx/netch.git
synced 2026-03-22 18:29:46 +08:00
118 lines
2.7 KiB
C#
118 lines
2.7 KiB
C#
using System.Collections.Generic;
|
|
using Netch.Models;
|
|
|
|
namespace Netch.ServerEx.VMess
|
|
{
|
|
public class VMess : Server
|
|
{
|
|
public VMess()
|
|
{
|
|
Type = "VMess";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 用户 ID
|
|
/// </summary>
|
|
public string UserID { get; set; }
|
|
|
|
/// <summary>
|
|
/// 额外 ID
|
|
/// </summary>
|
|
public int AlterID { get; set; }
|
|
|
|
/// <summary>
|
|
/// 加密方式
|
|
/// </summary>
|
|
public string EncryptMethod { get; set; } = VMessGlobal.EncryptMethods[0];
|
|
|
|
|
|
/// <summary>
|
|
/// 传输协议
|
|
/// </summary>
|
|
public string TransferProtocol { get; set; } = VMessGlobal.TransferProtocols[0];
|
|
|
|
/// <summary>
|
|
/// 伪装类型
|
|
/// </summary>
|
|
public string FakeType { get; set; } = VMessGlobal.FakeTypes[0];
|
|
|
|
/// <summary>
|
|
/// QUIC
|
|
/// </summary>
|
|
public string QUIC { get; set; } = VMessGlobal.QUIC[0];
|
|
|
|
/// <summary>
|
|
/// 伪装域名
|
|
/// </summary>
|
|
public string Host { get; set; }
|
|
|
|
/// <summary>
|
|
/// 传输路径
|
|
/// </summary>
|
|
public string Path { get; set; }
|
|
|
|
/// <summary>
|
|
/// QUIC 加密方式
|
|
/// </summary>
|
|
public string QUICSecure { get; set; } = VMessGlobal.QUIC[0];
|
|
|
|
/// <summary>
|
|
/// QUIC 加密密钥
|
|
/// </summary>
|
|
public string QUICSecret { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// TLS 底层传输安全
|
|
/// </summary>
|
|
public bool TLSSecure { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Mux 多路复用
|
|
/// </summary>
|
|
public bool UseMux { get; set; } = true;
|
|
}
|
|
|
|
public class VMessGlobal
|
|
{
|
|
public static readonly List<string> EncryptMethods = new List<string>
|
|
{
|
|
"auto",
|
|
"none",
|
|
"aes-128-gcm",
|
|
"chacha20-poly1305"
|
|
};
|
|
|
|
public static readonly List<string> QUIC = new List<string>
|
|
{
|
|
"none",
|
|
"aes-128-gcm",
|
|
"chacha20-poly1305"
|
|
};
|
|
|
|
/// <summary>
|
|
/// V2Ray 传输协议
|
|
/// </summary>
|
|
public static readonly List<string> TransferProtocols = new List<string>
|
|
{
|
|
"tcp",
|
|
"kcp",
|
|
"ws",
|
|
"h2",
|
|
"quic"
|
|
};
|
|
|
|
/// <summary>
|
|
/// V2Ray 伪装类型
|
|
/// </summary>
|
|
public static readonly List<string> FakeTypes = new List<string>
|
|
{
|
|
"none",
|
|
"http",
|
|
"srtp",
|
|
"utp",
|
|
"wechat-video",
|
|
"dtls",
|
|
"wireguard"
|
|
};
|
|
}
|
|
} |