@remnawave/xtls-sdk 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,176 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- import { Network } from "../../common/net/network";
3
- import { PortList } from "../../common/net/port";
4
- import { TypedMessage } from "../../common/serial/typed_message";
5
- export declare const protobufPackage = "xray.app.router";
6
- /** Domain for routing decision. */
7
- export interface Domain {
8
- $type: "xray.app.router.Domain";
9
- /** Domain matching type. */
10
- type: Domain_Type;
11
- /** Domain value. */
12
- value: string;
13
- /** Attributes of this domain. May be used for filtering. */
14
- attribute: Domain_Attribute[];
15
- }
16
- /** Type of domain value. */
17
- export declare enum Domain_Type {
18
- /** Plain - The value is used as is. */
19
- Plain = 0,
20
- /** Regex - The value is used as a regular expression. */
21
- Regex = 1,
22
- /** Domain - The value is a root domain. */
23
- Domain = 2,
24
- /** Full - The value is a domain. */
25
- Full = 3,
26
- UNRECOGNIZED = -1
27
- }
28
- export declare function domain_TypeFromJSON(object: any): Domain_Type;
29
- export declare function domain_TypeToJSON(object: Domain_Type): string;
30
- export interface Domain_Attribute {
31
- $type: "xray.app.router.Domain.Attribute";
32
- key: string;
33
- boolValue?: boolean | undefined;
34
- intValue?: number | undefined;
35
- }
36
- /** IP for routing decision, in CIDR form. */
37
- export interface CIDR {
38
- $type: "xray.app.router.CIDR";
39
- /** IP address, should be either 4 or 16 bytes. */
40
- ip: Uint8Array;
41
- /** Number of leading ones in the network mask. */
42
- prefix: number;
43
- }
44
- export interface GeoIP {
45
- $type: "xray.app.router.GeoIP";
46
- countryCode: string;
47
- cidr: CIDR[];
48
- reverseMatch: boolean;
49
- }
50
- export interface GeoIPList {
51
- $type: "xray.app.router.GeoIPList";
52
- entry: GeoIP[];
53
- }
54
- export interface GeoSite {
55
- $type: "xray.app.router.GeoSite";
56
- countryCode: string;
57
- domain: Domain[];
58
- }
59
- export interface GeoSiteList {
60
- $type: "xray.app.router.GeoSiteList";
61
- entry: GeoSite[];
62
- }
63
- export interface RoutingRule {
64
- $type: "xray.app.router.RoutingRule";
65
- /** Tag of outbound that this rule is pointing to. */
66
- tag?: string | undefined;
67
- /** Tag of routing balancer. */
68
- balancingTag?: string | undefined;
69
- ruleTag: string;
70
- /** List of domains for target domain matching. */
71
- domain: Domain[];
72
- /**
73
- * List of GeoIPs for target IP address matching. If this entry exists, the
74
- * cidr above will have no effect. GeoIP fields with the same country code are
75
- * supposed to contain exactly same content. They will be merged during
76
- * runtime. For customized GeoIPs, please leave country code empty.
77
- */
78
- geoip: GeoIP[];
79
- /** List of ports. */
80
- portList: PortList | undefined;
81
- /** List of networks for matching. */
82
- networks: Network[];
83
- /**
84
- * List of GeoIPs for source IP address matching. If this entry exists, the
85
- * source_cidr above will have no effect.
86
- */
87
- sourceGeoip: GeoIP[];
88
- /** List of ports for source port matching. */
89
- sourcePortList: PortList | undefined;
90
- userEmail: string[];
91
- inboundTag: string[];
92
- protocol: string[];
93
- attributes: {
94
- [key: string]: string;
95
- };
96
- domainMatcher: string;
97
- }
98
- export interface RoutingRule_AttributesEntry {
99
- $type: "xray.app.router.RoutingRule.AttributesEntry";
100
- key: string;
101
- value: string;
102
- }
103
- export interface BalancingRule {
104
- $type: "xray.app.router.BalancingRule";
105
- tag: string;
106
- outboundSelector: string[];
107
- strategy: string;
108
- strategySettings: TypedMessage | undefined;
109
- fallbackTag: string;
110
- }
111
- export interface StrategyWeight {
112
- $type: "xray.app.router.StrategyWeight";
113
- regexp: boolean;
114
- match: string;
115
- value: number;
116
- }
117
- export interface StrategyLeastLoadConfig {
118
- $type: "xray.app.router.StrategyLeastLoadConfig";
119
- /** weight settings */
120
- costs: StrategyWeight[];
121
- /** RTT baselines for selecting, int64 values of time.Duration */
122
- baselines: number[];
123
- /** expected nodes count to select */
124
- expected: number;
125
- /** max acceptable rtt, filter away high delay nodes. default 0 */
126
- maxRTT: number;
127
- /** acceptable failure rate */
128
- tolerance: number;
129
- }
130
- export interface Config {
131
- $type: "xray.app.router.Config";
132
- domainStrategy: Config_DomainStrategy;
133
- rule: RoutingRule[];
134
- balancingRule: BalancingRule[];
135
- }
136
- export declare enum Config_DomainStrategy {
137
- /** AsIs - Use domain as is. */
138
- AsIs = 0,
139
- /** UseIp - Always resolve IP for domains. */
140
- UseIp = 1,
141
- /** IpIfNonMatch - Resolve to IP if the domain doesn't match any rules. */
142
- IpIfNonMatch = 2,
143
- /** IpOnDemand - Resolve to IP if any rule requires IP matching. */
144
- IpOnDemand = 3,
145
- UNRECOGNIZED = -1
146
- }
147
- export declare function config_DomainStrategyFromJSON(object: any): Config_DomainStrategy;
148
- export declare function config_DomainStrategyToJSON(object: Config_DomainStrategy): string;
149
- export declare const Domain: MessageFns<Domain, "xray.app.router.Domain">;
150
- export declare const Domain_Attribute: MessageFns<Domain_Attribute, "xray.app.router.Domain.Attribute">;
151
- export declare const CIDR: MessageFns<CIDR, "xray.app.router.CIDR">;
152
- export declare const GeoIP: MessageFns<GeoIP, "xray.app.router.GeoIP">;
153
- export declare const GeoIPList: MessageFns<GeoIPList, "xray.app.router.GeoIPList">;
154
- export declare const GeoSite: MessageFns<GeoSite, "xray.app.router.GeoSite">;
155
- export declare const GeoSiteList: MessageFns<GeoSiteList, "xray.app.router.GeoSiteList">;
156
- export declare const RoutingRule: MessageFns<RoutingRule, "xray.app.router.RoutingRule">;
157
- export declare const RoutingRule_AttributesEntry: MessageFns<RoutingRule_AttributesEntry, "xray.app.router.RoutingRule.AttributesEntry">;
158
- export declare const BalancingRule: MessageFns<BalancingRule, "xray.app.router.BalancingRule">;
159
- export declare const StrategyWeight: MessageFns<StrategyWeight, "xray.app.router.StrategyWeight">;
160
- export declare const StrategyLeastLoadConfig: MessageFns<StrategyLeastLoadConfig, "xray.app.router.StrategyLeastLoadConfig">;
161
- export declare const Config: MessageFns<Config, "xray.app.router.Config">;
162
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
163
- export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
164
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
165
- } : Partial<T>;
166
- export interface MessageFns<T, V extends string> {
167
- readonly $type: V;
168
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
169
- decode(input: BinaryReader | Uint8Array, length?: number): T;
170
- fromJSON(object: any): T;
171
- toJSON(message: T): unknown;
172
- create(base?: DeepPartial<T>): T;
173
- fromPartial(object: DeepPartial<T>): T;
174
- }
175
- export {};
176
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/app/router/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAkC,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGjE,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD,mCAAmC;AACnC,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,wBAAwB,CAAC;IAChC,4BAA4B;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,SAAS,EAAE,gBAAgB,EAAE,CAAC;CAC/B;AAED,4BAA4B;AAC5B,oBAAY,WAAW;IACrB,uCAAuC;IACvC,KAAK,IAAI;IACT,yDAAyD;IACzD,KAAK,IAAI;IACT,2CAA2C;IAC3C,MAAM,IAAI;IACV,oCAAoC;IACpC,IAAI,IAAI;IACR,YAAY,KAAK;CAClB;AAED,wBAAgB,mBAAmB,CAAC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