using System.Text.Json.Serialization;
namespace ServiceLib.Models
{
///
/// v2ray配置文件实体类 例子SampleConfig.txt
///
public class V2rayConfig
{
///
/// Properties that do not belong to Ray
///
public string? remarks { get; set; }
///
/// 日志配置
///
public Log4Ray log { get; set; }
///
/// 传入连接配置
///
public List inbounds { get; set; }
///
/// 传出连接配置
///
public List outbounds { get; set; }
///
/// 统计需要, 空对象
///
public Stats4Ray stats { get; set; }
///
public API4Ray api { get; set; }
///
public Policy4Ray policy { get; set; }
///
/// DNS 配置
///
public object dns { get; set; }
///
/// 路由配置
///
public Routing4Ray routing { get; set; }
}
public class Stats4Ray
{ };
public class API4Ray
{
public string tag { get; set; }
public List services { get; set; }
}
public class Policy4Ray
{
public SystemPolicy4Ray system { get; set; }
}
public class SystemPolicy4Ray
{
public bool statsOutboundUplink { get; set; }
public bool statsOutboundDownlink { get; set; }
}
public class Log4Ray
{
///
///
///
public string access { get; set; }
///
///
///
public string error { get; set; }
///
///
///
public string loglevel { get; set; }
}
public class Inbounds4Ray
{
public string tag { get; set; }
///
///
///
public int port { get; set; }
///
///
///
public string listen { get; set; }
///
///
///
public string protocol { get; set; }
///
///
///
public Sniffing4Ray sniffing { get; set; }
///
///
///
public Inboundsettings4Ray settings { get; set; }
///
///
///
public StreamSettings4Ray streamSettings { get; set; }
}
public class Inboundsettings4Ray
{
///
///
///
public string auth { get; set; }
///
///
///
public bool udp { get; set; }
///
///
///
public string ip { get; set; }
///
/// api 使用
///
public string address { get; set; }
///
///
///
public List clients { get; set; }
///
/// VLESS
///
public string decryption { get; set; }
public bool allowTransparent { get; set; }
public List accounts { get; set; }
}
public class UsersItem4Ray
{
///
///
///
public string id { get; set; }
///
///
///
public int alterId { get; set; }
///
///
///
public string email { get; set; }
///
///
///
public string security { get; set; }
///
/// VLESS
///
public string encryption { get; set; }
///
/// VLESS
///
public string? flow { get; set; }
}
public class Sniffing4Ray
{
public bool enabled { get; set; }
public List? destOverride { get; set; }
public bool routeOnly { get; set; }
}
public class Outbounds4Ray
{
///
/// 默认值agentout
///
public string tag { get; set; }
///
///
///
public string protocol { get; set; }
///
///
///
public Outboundsettings4Ray settings { get; set; }
///
///
///
public StreamSettings4Ray streamSettings { get; set; }
///
///
///
public Mux4Ray mux { get; set; }
}
public class Outboundsettings4Ray
{
///
///
///
public List? vnext { get; set; }
///
///
///
public List servers { get; set; }
///
///
///
public Response4Ray response { get; set; }
///
///
///
public string domainStrategy { get; set; }
///
///
///
public int? userLevel { get; set; }
public FragmentItem4Ray? fragment { get; set; }
}
public class VnextItem4Ray
{
///
///
///
public string address { get; set; }
///
///
///
public int port { get; set; }
///
///
///
public List users { get; set; }
}
public class ServersItem4Ray
{
///
///
///
public string email { get; set; }
///
///
///
public string address { get; set; }
///
///
///
public string? method { get; set; }
///
///
///
public bool? ota { get; set; }
///
///
///
public string? password { get; set; }
///
///
///
public int port { get; set; }
///
///
///
public int? level { get; set; }
///
/// trojan
///
public string flow { get; set; }
///
///
///
public List users { get; set; }
}
public class SocksUsersItem4Ray
{
///
///
///
public string user { get; set; }
///
///
///
public string pass { get; set; }
///
///
///
public int? level { get; set; }
}
public class Mux4Ray
{
public bool enabled { get; set; }
public int? concurrency { get; set; }
public int? xudpConcurrency { get; set; }
public string? xudpProxyUDP443 { get; set; }
}
public class Response4Ray
{
///
///
///
public string type { get; set; }
}
public class Dns4Ray
{
///
///
///
public List servers { get; set; }
}
public class DnsServer4Ray
{
public string? address { get; set; }
public List? domains { get; set; }
}
public class Routing4Ray
{
///
///
///
public string domainStrategy { get; set; }
///
///
///
public string? domainMatcher { get; set; }
///
///
///
public List rules { get; set; }
public List? balancers { get; set; }
}
[Serializable]
public class RulesItem4Ray
{
public string? type { get; set; }
public string? port { get; set; }
public string? network { get; set; }
public List? inboundTag { get; set; }
public string? outboundTag { get; set; }
public string? balancerTag { get; set; }
public List? ip { get; set; }
public List? domain { get; set; }
public List? protocol { get; set; }
}
public class BalancersItem4Ray
{
public List? selector { get; set; }
public BalancersStrategy4Ray? strategy { get; set; }
public string? tag { get; set; }
}
public class BalancersStrategy4Ray
{
public string? type { get; set; }
}
public class StreamSettings4Ray
{
///
///
///
public string network { get; set; }
///
///
///
public string security { get; set; }
///
///
///
public TlsSettings4Ray? tlsSettings { get; set; }
///
/// Tcp传输额外设置
///
public TcpSettings4Ray? tcpSettings { get; set; }
///
/// Kcp传输额外设置
///
public KcpSettings4Ray? kcpSettings { get; set; }
///
/// ws传输额外设置
///
public WsSettings4Ray? wsSettings { get; set; }
///
///
///
public HttpupgradeSettings4Ray? httpupgradeSettings { get; set; }
///
///
///
public SplithttpSettings4Ray? splithttpSettings { get; set; }
///
/// h2传输额外设置
///
public HttpSettings4Ray? httpSettings { get; set; }
///
/// QUIC
///
public QuicSettings4Ray? quicSettings { get; set; }
///
/// VLESS only
///
public TlsSettings4Ray? realitySettings { get; set; }
///
/// grpc
///
public GrpcSettings4Ray? grpcSettings { get; set; }
///
/// sockopt
///
public Sockopt4Ray? sockopt { get; set; }
}
public class TlsSettings4Ray
{
///
/// 是否允许不安全连接(用于客户端)
///
public bool? allowInsecure { get; set; }
///
///
///
public string? serverName { get; set; }
///
///
///
public List? alpn { get; set; }
public string? fingerprint { get; set; }
public bool? show { get; set; }
public string? publicKey { get; set; }
public string? shortId { get; set; }
public string? spiderX { get; set; }
}
public class TcpSettings4Ray
{
///
/// 数据包头部伪装设置
///
public Header4Ray header { get; set; }
}
public class Header4Ray
{
///
/// 伪装
///
public string type { get; set; }
///
/// 结构复杂,直接存起来
///
public object request { get; set; }
///
/// 结构复杂,直接存起来
///
public object response { get; set; }
}
public class KcpSettings4Ray
{
///
///
///
public int mtu { get; set; }
///
///
///
public int tti { get; set; }
///
///
///
public int uplinkCapacity { get; set; }
///
///
///
public int downlinkCapacity { get; set; }
///
///
///
public bool congestion { get; set; }
///
///
///
public int readBufferSize { get; set; }
///
///
///
public int writeBufferSize { get; set; }
///
///
///
public Header4Ray header { get; set; }
///
///
///
public string seed { get; set; }
}
public class WsSettings4Ray
{
///
///
///
public string path { get; set; }
///
///
///
public Headers4Ray headers { get; set; }
}
public class Headers4Ray
{
///
///
///
public string Host { get; set; }
///
/// 用户代理
///
[JsonPropertyName("User-Agent")]
public string UserAgent { get; set; }
}
public class HttpupgradeSettings4Ray
{
///
///
///
public string? path { get; set; }
///
///
///
public string? host { get; set; }
}
public class SplithttpSettings4Ray
{
public string? path { get; set; }
public string? host { get; set; }
public int? maxUploadSize { get; set; }
public int? maxConcurrentUploads { get; set; }
}
public class HttpSettings4Ray
{
///
///
///
public string? path { get; set; }
///
///
///
public List? host { get; set; }
}
public class QuicSettings4Ray
{
///
///
///
public string security { get; set; }
///
///
///
public string key { get; set; }
///
///
///
public Header4Ray header { get; set; }
}
public class GrpcSettings4Ray
{
public string? authority { get; set; }
public string? serviceName { get; set; }
public bool multiMode { get; set; }
public int idle_timeout { get; set; }
public int health_check_timeout { get; set; }
public bool permit_without_stream { get; set; }
public int initial_windows_size { get; set; }
}
public class AccountsItem4Ray
{
///
///
///
public string user { get; set; }
///
///
///
public string pass { get; set; }
}
public class Sockopt4Ray
{
public string? dialerProxy { get; set; }
}
public class FragmentItem4Ray
{
public string? packets { get; set; }
public string? length { get; set; }
public string? interval { get; set; }
}
}