import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Network } from "../../common/net/network"; import { PortList } from "../../common/net/port"; import { TypedMessage } from "../../common/serial/typed_message"; export declare const protobufPackage = "xray.app.router"; /** Domain for routing decision. */ export interface Domain { $type: "xray.app.router.Domain"; /** Domain matching type. */ type: Domain_Type; /** Domain value. */ value: string; /** Attributes of this domain. May be used for filtering. */ attribute: Domain_Attribute[]; } /** Type of domain value. */ export declare enum Domain_Type { /** Plain - The value is used as is. */ Plain = 0, /** Regex - The value is used as a regular expression. */ Regex = 1, /** Domain - The value is a root domain. */ Domain = 2, /** Full - The value is a domain. */ Full = 3, UNRECOGNIZED = -1 } export declare function domain_TypeFromJSON(object: any): Domain_Type; export declare function domain_TypeToJSON(object: Domain_Type): string; export interface Domain_Attribute { $type: "xray.app.router.Domain.Attribute"; key: string; boolValue?: boolean | undefined; intValue?: number | undefined; } /** IP for routing decision, in CIDR form. */ export interface CIDR { $type: "xray.app.router.CIDR"; /** IP address, should be either 4 or 16 bytes. */ ip: Uint8Array; /** Number of leading ones in the network mask. */ prefix: number; } export interface GeoIP { $type: "xray.app.router.GeoIP"; countryCode: string; cidr: CIDR[]; reverseMatch: boolean; } export interface GeoIPList { $type: "xray.app.router.GeoIPList"; entry: GeoIP[]; } export interface GeoSite { $type: "xray.app.router.GeoSite"; countryCode: string; domain: Domain[]; } export interface GeoSiteList { $type: "xray.app.router.GeoSiteList"; entry: GeoSite[]; } export interface RoutingRule { $type: "xray.app.router.RoutingRule"; /** Tag of outbound that this rule is pointing to. */ tag?: string | undefined; /** Tag of routing balancer. */ balancingTag?: string | undefined; ruleTag: string; /** List of domains for target domain matching. */ domain: Domain[]; /** * List of GeoIPs for target IP address matching. If this entry exists, the * cidr above will have no effect. GeoIP fields with the same country code are * supposed to contain exactly same content. They will be merged during * runtime. For customized GeoIPs, please leave country code empty. */ geoip: GeoIP[]; /** List of ports. */ portList: PortList | undefined; /** List of networks for matching. */ networks: Network[]; /** * List of GeoIPs for source IP address matching. If this entry exists, the * source_cidr above will have no effect. */ sourceGeoip: GeoIP[]; /** List of ports for source port matching. */ sourcePortList: PortList | undefined; userEmail: string[]; inboundTag: string[]; protocol: string[]; attributes: { [key: string]: string; }; localGeoip: GeoIP[]; localPortList: PortList | undefined; vlessRouteList: PortList | undefined; } export interface RoutingRule_AttributesEntry { $type: "xray.app.router.RoutingRule.AttributesEntry"; key: string; value: string; } export interface BalancingRule { $type: "xray.app.router.BalancingRule"; tag: string; outboundSelector: string[]; strategy: string; strategySettings: TypedMessage | undefined; fallbackTag: string; } export interface StrategyWeight { $type: "xray.app.router.StrategyWeight"; regexp: boolean; match: string; value: number; } export interface StrategyLeastLoadConfig { $type: "xray.app.router.StrategyLeastLoadConfig"; /** weight settings */ costs: StrategyWeight[]; /** RTT baselines for selecting, int64 values of time.Duration */ baselines: number[]; /** expected nodes count to select */ expected: number; /** max acceptable rtt, filter away high delay nodes. default 0 */ maxRTT: number; /** acceptable failure rate */ tolerance: number; } export interface Config { $type: "xray.app.router.Config"; domainStrategy: Config_DomainStrategy; rule: RoutingRule[]; balancingRule: BalancingRule[]; } export declare enum Config_DomainStrategy { /** AsIs - Use domain as is. */ AsIs = 0, /** IpIfNonMatch - Resolve to IP if the domain doesn't match any rules. */ IpIfNonMatch = 2, /** IpOnDemand - Resolve to IP if any rule requires IP matching. */ IpOnDemand = 3, UNRECOGNIZED = -1 } export declare function config_DomainStrategyFromJSON(object: any): Config_DomainStrategy; export declare function config_DomainStrategyToJSON(object: Config_DomainStrategy): string; export declare const Domain: MessageFns; export declare const Domain_Attribute: MessageFns; export declare const CIDR: MessageFns; export declare const GeoIP: MessageFns; export declare const GeoIPList: MessageFns; export declare const GeoSite: MessageFns; export declare const GeoSiteList: MessageFns; export declare const RoutingRule: MessageFns; export declare const RoutingRule_AttributesEntry: MessageFns; export declare const BalancingRule: MessageFns; export declare const StrategyWeight: MessageFns; export declare const StrategyLeastLoadConfig: MessageFns; export declare const Config: MessageFns; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in Exclude]?: DeepPartial; } : Partial; export interface MessageFns { readonly $type: V; encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } export {}; //# sourceMappingURL=config.d.ts.map