/** * Routing configuration for Xray-Core. * * @see https://xtls.github.io/en/config/routing.html */ export interface RoutingConfig { /** Domain resolution strategy for routing. */ domainStrategy?: RoutingDomainStrategy; /** Routing rules evaluated in order. */ rules?: RoutingRule[]; /** Load balancing rules. */ balancers?: BalancingRule[]; } export interface RoutingRule { /** Rule tag for identification in logs and referencing. */ ruleTag?: string; /** Domain matching patterns (e.g. "domain:example.com", "geosite:cn", "regexp:.*\\.cn$"). */ domain?: string[]; /** Alias for domain field. */ domains?: string[]; /** IP matching patterns (e.g. "0.0.0.0/8", "geoip:cn", "10.0.0.0/8"). */ ip?: string[]; /** Port or port range (e.g. "80", "1-1024", "53,443,1000-2000"). */ port?: string | number; /** Source port matching. */ sourcePort?: string | number; /** Network type filter. */ network?: NetworkType; /** Source IP matching patterns. */ source?: string[]; /** Alias for source field. */ sourceIP?: string[]; /** Match by user email (from proxy user config). */ user?: string[]; /** Match by inbound tag. */ inboundTag?: string[]; /** Match by detected protocol (e.g. "http", "tls", "bittorrent"). */ protocol?: SniffProtocol[]; /** Match by domain attributes. */ attrs?: Record; /** Target outbound tag. */ outboundTag?: string; /** Target balancer tag (mutually exclusive with outboundTag). */ balancerTag?: string; /** VLESS route matching by port. */ vlessRoute?: string | number; /** Local IP matching (for transparent proxy). */ localIP?: string[]; /** Local port matching. */ localPort?: string | number; /** Process name matching (for transparent proxy). */ process?: string[]; /** Webhook configuration for rule matching notifications. */ webhook?: WebhookRuleConfig; /** Remnawave Custom Field, snippet configuration for rule matching. */ snippet?: string; } export interface WebhookRuleConfig { /** Webhook URL to call on rule match. */ url?: string; /** Deduplication interval in seconds. */ deduplication?: number; /** HTTP headers for webhook request. */ headers?: Record; } export interface BalancingRule { /** Tag for this balancing rule. */ tag?: string; /** Outbound tag selectors (supports prefix matching). */ selector?: string[]; /** Balancing strategy. */ strategy?: BalancingStrategy; /** Fallback tag when all selected outbounds are unavailable. */ fallbackTag?: string; /** Remnawave Custom Field, snippet configuration for rule matching. */ snippet?: string; } export interface BalancingStrategy { /** Strategy type. */ type?: BalancingStrategyType; /** Strategy-specific settings. */ settings?: Record; } export type BalancingStrategyType = 'random' | 'leastPing' | 'roundRobin' | 'leastLoad'; export type RoutingDomainStrategy = 'AsIs' | 'UseIP' | 'UseIPv4' | 'UseIPv6' | 'UseIPv4v6' | 'UseIPv6v4' | 'ForceIP' | 'ForceIPv4' | 'ForceIPv6' | 'ForceIPv4v6' | 'ForceIPv6v4'; export type NetworkType = 'tcp' | 'udp' | 'tcp,udp'; export type SniffProtocol = 'http' | 'tls' | 'quic' | 'fakedns' | 'bittorrent'; //# sourceMappingURL=routing.d.ts.map