sing-box-kit 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,3974 @@
1
+ import "ajv";
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ type DNSServer = {
8
+ type: "dhcp";
9
+ tag?: string;
10
+ detour?: string;
11
+ bind_interface?: string;
12
+ inet4_bind_address?: string;
13
+ inet6_bind_address?: string;
14
+ bind_address_no_port?: boolean;
15
+ protect_path?: string;
16
+ routing_mark?: number | string;
17
+ reuse_addr?: boolean;
18
+ netns?: string;
19
+ connect_timeout?: Duration;
20
+ tcp_fast_open?: boolean;
21
+ tcp_multi_path?: boolean;
22
+ disable_tcp_keep_alive?: boolean;
23
+ tcp_keep_alive?: Duration;
24
+ tcp_keep_alive_interval?: Duration;
25
+ udp_fragment?: boolean;
26
+ domain_resolver?: DomainResolver$1;
27
+ network_strategy?: "default" | "fallback" | "hybrid";
28
+ network_type?: InterfaceType | InterfaceType[];
29
+ fallback_network_type?: InterfaceType | InterfaceType[];
30
+ fallback_delay?: Duration;
31
+ prefer_go?: boolean;
32
+ neighbor_domain?: string | string[];
33
+ interface?: string;
34
+ } | {
35
+ type: "fakeip";
36
+ tag?: string;
37
+ inet4_range?: string;
38
+ inet6_range?: string;
39
+ } | {
40
+ type: "h3";
41
+ tag?: string;
42
+ detour?: string;
43
+ bind_interface?: string;
44
+ inet4_bind_address?: string;
45
+ inet6_bind_address?: string;
46
+ bind_address_no_port?: boolean;
47
+ protect_path?: string;
48
+ routing_mark?: number | string;
49
+ reuse_addr?: boolean;
50
+ netns?: string;
51
+ connect_timeout?: Duration;
52
+ tcp_fast_open?: boolean;
53
+ tcp_multi_path?: boolean;
54
+ disable_tcp_keep_alive?: boolean;
55
+ tcp_keep_alive?: Duration;
56
+ tcp_keep_alive_interval?: Duration;
57
+ udp_fragment?: boolean;
58
+ domain_resolver?: DomainResolver$1;
59
+ network_strategy?: "default" | "fallback" | "hybrid";
60
+ network_type?: InterfaceType | InterfaceType[];
61
+ fallback_network_type?: InterfaceType | InterfaceType[];
62
+ fallback_delay?: Duration;
63
+ server?: string;
64
+ server_port?: number;
65
+ tls?: OutboundTLSOptions;
66
+ path?: string;
67
+ method?: string;
68
+ headers?: HTTPHeader;
69
+ } | {
70
+ type: "hosts";
71
+ tag?: string;
72
+ path?: string | string[];
73
+ predefined?: {
74
+ [k: string]: string | string[];
75
+ };
76
+ } | {
77
+ type: "https";
78
+ tag?: string;
79
+ detour?: string;
80
+ bind_interface?: string;
81
+ inet4_bind_address?: string;
82
+ inet6_bind_address?: string;
83
+ bind_address_no_port?: boolean;
84
+ protect_path?: string;
85
+ routing_mark?: number | string;
86
+ reuse_addr?: boolean;
87
+ netns?: string;
88
+ connect_timeout?: Duration;
89
+ tcp_fast_open?: boolean;
90
+ tcp_multi_path?: boolean;
91
+ disable_tcp_keep_alive?: boolean;
92
+ tcp_keep_alive?: Duration;
93
+ tcp_keep_alive_interval?: Duration;
94
+ udp_fragment?: boolean;
95
+ domain_resolver?: DomainResolver$1;
96
+ network_strategy?: "default" | "fallback" | "hybrid";
97
+ network_type?: InterfaceType | InterfaceType[];
98
+ fallback_network_type?: InterfaceType | InterfaceType[];
99
+ fallback_delay?: Duration;
100
+ server?: string;
101
+ server_port?: number;
102
+ tls?: OutboundTLSOptions;
103
+ path?: string;
104
+ method?: string;
105
+ headers?: HTTPHeader;
106
+ } | {
107
+ type: "local";
108
+ tag?: string;
109
+ detour?: string;
110
+ bind_interface?: string;
111
+ inet4_bind_address?: string;
112
+ inet6_bind_address?: string;
113
+ bind_address_no_port?: boolean;
114
+ protect_path?: string;
115
+ routing_mark?: number | string;
116
+ reuse_addr?: boolean;
117
+ netns?: string;
118
+ connect_timeout?: Duration;
119
+ tcp_fast_open?: boolean;
120
+ tcp_multi_path?: boolean;
121
+ disable_tcp_keep_alive?: boolean;
122
+ tcp_keep_alive?: Duration;
123
+ tcp_keep_alive_interval?: Duration;
124
+ udp_fragment?: boolean;
125
+ domain_resolver?: DomainResolver$1;
126
+ network_strategy?: "default" | "fallback" | "hybrid";
127
+ network_type?: InterfaceType | InterfaceType[];
128
+ fallback_network_type?: InterfaceType | InterfaceType[];
129
+ fallback_delay?: Duration;
130
+ prefer_go?: boolean;
131
+ neighbor_domain?: string | string[];
132
+ } | {
133
+ type: "mdns";
134
+ tag?: string;
135
+ detour?: string;
136
+ bind_interface?: string;
137
+ inet4_bind_address?: string;
138
+ inet6_bind_address?: string;
139
+ bind_address_no_port?: boolean;
140
+ protect_path?: string;
141
+ routing_mark?: number | string;
142
+ reuse_addr?: boolean;
143
+ netns?: string;
144
+ connect_timeout?: Duration;
145
+ tcp_fast_open?: boolean;
146
+ tcp_multi_path?: boolean;
147
+ disable_tcp_keep_alive?: boolean;
148
+ tcp_keep_alive?: Duration;
149
+ tcp_keep_alive_interval?: Duration;
150
+ udp_fragment?: boolean;
151
+ domain_resolver?: DomainResolver$1;
152
+ network_strategy?: "default" | "fallback" | "hybrid";
153
+ network_type?: InterfaceType | InterfaceType[];
154
+ fallback_network_type?: InterfaceType | InterfaceType[];
155
+ fallback_delay?: Duration;
156
+ prefer_go?: boolean;
157
+ neighbor_domain?: string | string[];
158
+ interface?: string | string[];
159
+ } | {
160
+ type: "openconnect";
161
+ tag?: string;
162
+ endpoint?: string;
163
+ accept_default_resolvers?: boolean;
164
+ accept_search_domain?: boolean;
165
+ } | {
166
+ type: "openvpn";
167
+ tag?: string;
168
+ endpoint?: string;
169
+ accept_default_resolvers?: boolean;
170
+ accept_search_domain?: boolean;
171
+ } | {
172
+ type: "quic";
173
+ tag?: string;
174
+ detour?: string;
175
+ bind_interface?: string;
176
+ inet4_bind_address?: string;
177
+ inet6_bind_address?: string;
178
+ bind_address_no_port?: boolean;
179
+ protect_path?: string;
180
+ routing_mark?: number | string;
181
+ reuse_addr?: boolean;
182
+ netns?: string;
183
+ connect_timeout?: Duration;
184
+ tcp_fast_open?: boolean;
185
+ tcp_multi_path?: boolean;
186
+ disable_tcp_keep_alive?: boolean;
187
+ tcp_keep_alive?: Duration;
188
+ tcp_keep_alive_interval?: Duration;
189
+ udp_fragment?: boolean;
190
+ domain_resolver?: DomainResolver$1;
191
+ network_strategy?: "default" | "fallback" | "hybrid";
192
+ network_type?: InterfaceType | InterfaceType[];
193
+ fallback_network_type?: InterfaceType | InterfaceType[];
194
+ fallback_delay?: Duration;
195
+ server?: string;
196
+ server_port?: number;
197
+ tls?: OutboundTLSOptions;
198
+ } | {
199
+ type: "resolved";
200
+ tag?: string;
201
+ service?: string;
202
+ accept_default_resolvers?: boolean;
203
+ } | {
204
+ type: "tailscale";
205
+ tag?: string;
206
+ endpoint?: string;
207
+ accept_default_resolvers?: boolean;
208
+ accept_search_domain?: boolean;
209
+ } | {
210
+ type: "tcp";
211
+ tag?: string;
212
+ detour?: string;
213
+ bind_interface?: string;
214
+ inet4_bind_address?: string;
215
+ inet6_bind_address?: string;
216
+ bind_address_no_port?: boolean;
217
+ protect_path?: string;
218
+ routing_mark?: number | string;
219
+ reuse_addr?: boolean;
220
+ netns?: string;
221
+ connect_timeout?: Duration;
222
+ tcp_fast_open?: boolean;
223
+ tcp_multi_path?: boolean;
224
+ disable_tcp_keep_alive?: boolean;
225
+ tcp_keep_alive?: Duration;
226
+ tcp_keep_alive_interval?: Duration;
227
+ udp_fragment?: boolean;
228
+ domain_resolver?: DomainResolver$1;
229
+ network_strategy?: "default" | "fallback" | "hybrid";
230
+ network_type?: InterfaceType | InterfaceType[];
231
+ fallback_network_type?: InterfaceType | InterfaceType[];
232
+ fallback_delay?: Duration;
233
+ server?: string;
234
+ server_port?: number;
235
+ } | {
236
+ type: "tls";
237
+ tag?: string;
238
+ detour?: string;
239
+ bind_interface?: string;
240
+ inet4_bind_address?: string;
241
+ inet6_bind_address?: string;
242
+ bind_address_no_port?: boolean;
243
+ protect_path?: string;
244
+ routing_mark?: number | string;
245
+ reuse_addr?: boolean;
246
+ netns?: string;
247
+ connect_timeout?: Duration;
248
+ tcp_fast_open?: boolean;
249
+ tcp_multi_path?: boolean;
250
+ disable_tcp_keep_alive?: boolean;
251
+ tcp_keep_alive?: Duration;
252
+ tcp_keep_alive_interval?: Duration;
253
+ udp_fragment?: boolean;
254
+ domain_resolver?: DomainResolver$1;
255
+ network_strategy?: "default" | "fallback" | "hybrid";
256
+ network_type?: InterfaceType | InterfaceType[];
257
+ fallback_network_type?: InterfaceType | InterfaceType[];
258
+ fallback_delay?: Duration;
259
+ server?: string;
260
+ server_port?: number;
261
+ tls?: OutboundTLSOptions;
262
+ } | {
263
+ type: "udp";
264
+ tag?: string;
265
+ detour?: string;
266
+ bind_interface?: string;
267
+ inet4_bind_address?: string;
268
+ inet6_bind_address?: string;
269
+ bind_address_no_port?: boolean;
270
+ protect_path?: string;
271
+ routing_mark?: number | string;
272
+ reuse_addr?: boolean;
273
+ netns?: string;
274
+ connect_timeout?: Duration;
275
+ tcp_fast_open?: boolean;
276
+ tcp_multi_path?: boolean;
277
+ disable_tcp_keep_alive?: boolean;
278
+ tcp_keep_alive?: Duration;
279
+ tcp_keep_alive_interval?: Duration;
280
+ udp_fragment?: boolean;
281
+ domain_resolver?: DomainResolver$1;
282
+ network_strategy?: "default" | "fallback" | "hybrid";
283
+ network_type?: InterfaceType | InterfaceType[];
284
+ fallback_network_type?: InterfaceType | InterfaceType[];
285
+ fallback_delay?: Duration;
286
+ server?: string;
287
+ server_port?: number;
288
+ };
289
+ type Duration = string;
290
+ type DomainResolver$1 = string | {
291
+ server: string;
292
+ timeout?: Duration;
293
+ strategy?: DomainStrategy;
294
+ disable_cache?: boolean;
295
+ disable_optimistic_cache?: boolean;
296
+ rewrite_ttl?: number;
297
+ client_subnet?: string;
298
+ };
299
+ type DomainStrategy = "" | "as_is" | "prefer_ipv4" | "prefer_ipv6" | "ipv4_only" | "ipv6_only";
300
+ type InterfaceType = "cellular" | "ethernet" | "other" | "wifi";
301
+ type DNSRule = ({
302
+ type?: "default" | "";
303
+ inbound?: string | string[];
304
+ ip_version?: 4 | 6;
305
+ query_type?: DNSQueryType | DNSQueryType[];
306
+ query_client_subnet?: string | string[];
307
+ query_dnssec?: boolean;
308
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
309
+ auth_user?: string | string[];
310
+ protocol?: ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp") | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")[];
311
+ domain?: string | string[];
312
+ domain_suffix?: string | string[];
313
+ domain_keyword?: string | string[];
314
+ domain_regex?: string | string[];
315
+ source_ip_cidr?: string | string[];
316
+ source_ip_is_private?: boolean;
317
+ source_port?: number | number[];
318
+ source_port_range?: string | string[];
319
+ port?: number | number[];
320
+ port_range?: string | string[];
321
+ process_name?: string | string[];
322
+ process_path?: string | string[];
323
+ process_path_regex?: string | string[];
324
+ package_name?: string | string[];
325
+ package_name_regex?: string | string[];
326
+ user?: string | string[];
327
+ user_id?: number | number[];
328
+ clash_mode?: string;
329
+ network_type?: InterfaceType | InterfaceType[];
330
+ network_is_expensive?: boolean;
331
+ network_is_constrained?: boolean;
332
+ wifi_ssid?: string | string[];
333
+ wifi_bssid?: string | string[];
334
+ interface_address?: {
335
+ [k: string]: string | string[];
336
+ };
337
+ network_interface_address?: {
338
+ [k: string]: string | string[];
339
+ };
340
+ default_interface_address?: string | string[];
341
+ source_mac_address?: string | string[];
342
+ source_hostname?: string | string[];
343
+ preferred_by?: string | string[];
344
+ rule_set?: string | string[];
345
+ rule_set_ip_cidr_match_source?: boolean;
346
+ match_response?: boolean | string;
347
+ ip_cidr?: string | string[];
348
+ ip_is_private?: boolean;
349
+ ip_accept_any?: boolean;
350
+ response_rcode?: DNSRCode;
351
+ response_answer?: string | string[];
352
+ response_ns?: string | string[];
353
+ response_extra?: string | string[];
354
+ invert?: boolean;
355
+ } & DNSRuleAction) | ({
356
+ type: "logical";
357
+ mode: "and" | "or";
358
+ rules: NestedDNSRule[];
359
+ invert?: boolean;
360
+ } & DNSRuleAction);
361
+ type DNSQueryType = number | ("A" | "AAAA" | "AFSDB" | "AMTRELAY" | "ANY" | "APL" | "ATMA" | "AVC" | "AXFR" | "CAA" | "CDNSKEY" | "CDS" | "CERT" | "CNAME" | "CSYNC" | "DHCID" | "DLV" | "DNAME" | "DNSKEY" | "DS" | "EID" | "EUI48" | "EUI64" | "GID" | "GPOS" | "HINFO" | "HIP" | "HTTPS" | "IPSECKEY" | "ISDN" | "IXFR" | "KEY" | "KX" | "L32" | "L64" | "LOC" | "LP" | "MAILA" | "MAILB" | "MB" | "MD" | "MF" | "MG" | "MINFO" | "MR" | "MX" | "NAPTR" | "NID" | "NIMLOC" | "NINFO" | "NS" | "NSAP-PTR" | "NSEC" | "NSEC3" | "NSEC3PARAM" | "NULL" | "NXNAME" | "NXT" | "None" | "OPENPGPKEY" | "OPT" | "PTR" | "PX" | "RESINFO" | "RKEY" | "RP" | "RRSIG" | "RT" | "Reserved" | "SIG" | "SMIMEA" | "SOA" | "SPF" | "SRV" | "SSHFP" | "SVCB" | "TA" | "TALINK" | "TKEY" | "TLSA" | "TSIG" | "TXT" | "UID" | "UINFO" | "UNSPEC" | "URI" | "X25" | "ZONEMD");
362
+ type DNSRCode = number | ("NOERROR" | "FORMERR" | "SERVFAIL" | "NXDOMAIN" | "NOTIMP" | "NOTIMPL" | "REFUSED" | "YXDOMAIN" | "YXRRSET" | "NXRRSET" | "NOTAUTH" | "NOTZONE" | "DSOTYPENI" | "BADSIG" | "BADKEY" | "BADTIME" | "BADMODE" | "BADNAME" | "BADALG" | "BADTRUNC" | "BADCOOKIE");
363
+ type DNSRuleAction = {
364
+ action?: "route";
365
+ race?: boolean;
366
+ server?: string;
367
+ speculative?: boolean;
368
+ timeout?: Duration;
369
+ disable_cache?: boolean;
370
+ disable_optimistic_cache?: boolean;
371
+ rewrite_ttl?: number;
372
+ client_subnet?: string;
373
+ remove_client_subnet?: boolean;
374
+ } | {
375
+ action: "evaluate";
376
+ race?: boolean;
377
+ server?: string;
378
+ tag?: string;
379
+ speculative?: boolean;
380
+ timeout?: Duration;
381
+ disable_cache?: boolean;
382
+ disable_optimistic_cache?: boolean;
383
+ rewrite_ttl?: number;
384
+ client_subnet?: string;
385
+ remove_client_subnet?: boolean;
386
+ } | {
387
+ action: "respond";
388
+ race?: boolean;
389
+ } | {
390
+ action: "route-options";
391
+ race?: boolean;
392
+ timeout?: Duration;
393
+ disable_cache?: boolean;
394
+ disable_optimistic_cache?: boolean;
395
+ rewrite_ttl?: number;
396
+ client_subnet?: string;
397
+ remove_client_subnet?: boolean;
398
+ } | {
399
+ action: "reject";
400
+ race?: boolean;
401
+ method?: "" | "default" | "drop" | "reply";
402
+ no_drop?: boolean;
403
+ } | {
404
+ action: "predefined";
405
+ race?: boolean;
406
+ rcode?: DNSRCode;
407
+ answer?: string | string[];
408
+ ns?: string | string[];
409
+ extra?: string | string[];
410
+ };
411
+ type NestedDNSRule = {
412
+ type?: "default" | "";
413
+ inbound?: string | string[];
414
+ ip_version?: 4 | 6;
415
+ query_type?: DNSQueryType | DNSQueryType[];
416
+ query_client_subnet?: string | string[];
417
+ query_dnssec?: boolean;
418
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
419
+ auth_user?: string | string[];
420
+ protocol?: ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp") | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")[];
421
+ domain?: string | string[];
422
+ domain_suffix?: string | string[];
423
+ domain_keyword?: string | string[];
424
+ domain_regex?: string | string[];
425
+ source_ip_cidr?: string | string[];
426
+ source_ip_is_private?: boolean;
427
+ source_port?: number | number[];
428
+ source_port_range?: string | string[];
429
+ port?: number | number[];
430
+ port_range?: string | string[];
431
+ process_name?: string | string[];
432
+ process_path?: string | string[];
433
+ process_path_regex?: string | string[];
434
+ package_name?: string | string[];
435
+ package_name_regex?: string | string[];
436
+ user?: string | string[];
437
+ user_id?: number | number[];
438
+ clash_mode?: string;
439
+ network_type?: InterfaceType | InterfaceType[];
440
+ network_is_expensive?: boolean;
441
+ network_is_constrained?: boolean;
442
+ wifi_ssid?: string | string[];
443
+ wifi_bssid?: string | string[];
444
+ interface_address?: {
445
+ [k: string]: string | string[];
446
+ };
447
+ network_interface_address?: {
448
+ [k: string]: string | string[];
449
+ };
450
+ default_interface_address?: string | string[];
451
+ source_mac_address?: string | string[];
452
+ source_hostname?: string | string[];
453
+ preferred_by?: string | string[];
454
+ rule_set?: string | string[];
455
+ rule_set_ip_cidr_match_source?: boolean;
456
+ match_response?: boolean | string;
457
+ ip_cidr?: string | string[];
458
+ ip_is_private?: boolean;
459
+ ip_accept_any?: boolean;
460
+ response_rcode?: DNSRCode;
461
+ response_answer?: string | string[];
462
+ response_ns?: string | string[];
463
+ response_extra?: string | string[];
464
+ invert?: boolean;
465
+ } | {
466
+ type: "logical";
467
+ mode: "and" | "or";
468
+ rules: NestedDNSRule[];
469
+ invert?: boolean;
470
+ };
471
+ type CertificateProvider$1 = {
472
+ type: "acme";
473
+ tag?: string;
474
+ domain?: string | string[];
475
+ data_directory?: string;
476
+ default_server_name?: string;
477
+ email?: string;
478
+ provider?: string;
479
+ account_key?: string;
480
+ disable_http_challenge?: boolean;
481
+ disable_tls_alpn_challenge?: boolean;
482
+ alternative_http_port?: number;
483
+ alternative_tls_port?: number;
484
+ external_account?: ACMEExternalAccountOptions;
485
+ dns01_challenge?: ACMEProviderDNS01Challenge;
486
+ key_type?: "ed25519" | "p256" | "p384" | "rsa2048" | "rsa4096";
487
+ profile?: string;
488
+ http_client?: HTTPClientReference;
489
+ } | {
490
+ type: "cloudflare-origin-ca";
491
+ tag?: string;
492
+ domain?: string | string[];
493
+ data_directory?: string;
494
+ api_token?: string;
495
+ origin_ca_key?: string;
496
+ request_type?: "origin-rsa" | "origin-ecc";
497
+ requested_validity?: 0 | 7 | 30 | 90 | 365 | 730 | 1095 | 5475;
498
+ http_client?: HTTPClientReference;
499
+ } | {
500
+ type: "tailscale";
501
+ tag?: string;
502
+ endpoint?: string;
503
+ };
504
+ type ACMEProviderDNS01Challenge = {
505
+ provider: "alidns";
506
+ ttl?: Duration;
507
+ propagation_delay?: Duration;
508
+ propagation_timeout?: Duration;
509
+ resolvers?: string | string[];
510
+ override_domain?: string;
511
+ access_key_id?: string;
512
+ access_key_secret?: string;
513
+ region_id?: string;
514
+ security_token?: string;
515
+ } | {
516
+ provider: "cloudflare";
517
+ ttl?: Duration;
518
+ propagation_delay?: Duration;
519
+ propagation_timeout?: Duration;
520
+ resolvers?: string | string[];
521
+ override_domain?: string;
522
+ api_token?: string;
523
+ zone_token?: string;
524
+ } | {
525
+ provider: "acmedns";
526
+ ttl?: Duration;
527
+ propagation_delay?: Duration;
528
+ propagation_timeout?: Duration;
529
+ resolvers?: string | string[];
530
+ override_domain?: string;
531
+ username?: string;
532
+ password?: string;
533
+ subdomain?: string;
534
+ server_url?: string;
535
+ };
536
+ type HTTPClientReference = string | {
537
+ engine?: "go" | "apple";
538
+ version?: 0 | 1 | 2 | 3;
539
+ disable_version_fallback?: boolean;
540
+ headers?: HTTPHeader;
541
+ tls?: OutboundTLSOptions;
542
+ detour?: string;
543
+ bind_interface?: string;
544
+ inet4_bind_address?: string;
545
+ inet6_bind_address?: string;
546
+ bind_address_no_port?: boolean;
547
+ protect_path?: string;
548
+ routing_mark?: number | string;
549
+ reuse_addr?: boolean;
550
+ netns?: string;
551
+ connect_timeout?: Duration;
552
+ tcp_fast_open?: boolean;
553
+ tcp_multi_path?: boolean;
554
+ disable_tcp_keep_alive?: boolean;
555
+ tcp_keep_alive?: Duration;
556
+ tcp_keep_alive_interval?: Duration;
557
+ udp_fragment?: boolean;
558
+ domain_resolver?: DomainResolver$1;
559
+ network_strategy?: "default" | "fallback" | "hybrid";
560
+ network_type?: InterfaceType | InterfaceType[];
561
+ fallback_network_type?: InterfaceType | InterfaceType[];
562
+ fallback_delay?: Duration;
563
+ idle_timeout?: Duration;
564
+ keep_alive_period?: Duration;
565
+ stream_receive_window?: number | string;
566
+ connection_receive_window?: number | string;
567
+ max_concurrent_streams?: number;
568
+ initial_packet_size?: number;
569
+ disable_path_mtu_discovery?: boolean;
570
+ };
571
+ type NetworkNamespace = {
572
+ type?: "default" | "";
573
+ tag: string;
574
+ path?: string;
575
+ } | {
576
+ type: "unshare";
577
+ tag: string;
578
+ pid_file?: string;
579
+ };
580
+ type Endpoint = {
581
+ type: "openconnect";
582
+ tag?: string;
583
+ detour?: string;
584
+ bind_interface?: string;
585
+ inet4_bind_address?: string;
586
+ inet6_bind_address?: string;
587
+ bind_address_no_port?: boolean;
588
+ protect_path?: string;
589
+ routing_mark?: number | string;
590
+ reuse_addr?: boolean;
591
+ netns?: string;
592
+ connect_timeout?: Duration;
593
+ tcp_fast_open?: boolean;
594
+ tcp_multi_path?: boolean;
595
+ disable_tcp_keep_alive?: boolean;
596
+ tcp_keep_alive?: Duration;
597
+ tcp_keep_alive_interval?: Duration;
598
+ udp_fragment?: boolean;
599
+ domain_resolver?: DomainResolver$1;
600
+ network_strategy?: "default" | "fallback" | "hybrid";
601
+ network_type?: InterfaceType | InterfaceType[];
602
+ fallback_network_type?: InterfaceType | InterfaceType[];
603
+ fallback_delay?: Duration;
604
+ system?: boolean;
605
+ name?: string;
606
+ udp_timeout?: Duration;
607
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
608
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
609
+ udp_nat_max?: number;
610
+ server?: string;
611
+ flavor?: "anyconnect" | "gp" | "fortinet" | "f5" | "pulse" | "nc";
612
+ username?: string;
613
+ password?: string;
614
+ auth_group?: string;
615
+ cookie?: string;
616
+ token?: OpenConnectTokenOptions;
617
+ reported_os?: string;
618
+ user_agent?: string;
619
+ version?: string;
620
+ local_hostname?: string;
621
+ mobile?: OpenConnectMobileOptions;
622
+ csd?: OpenConnectCSDOptions;
623
+ hip?: OpenConnectHIPOptions;
624
+ tncc?: OpenConnectTNCCOptions;
625
+ fortinet_host_check?: OpenConnectFortinetHostCheckOptions;
626
+ no_udp?: boolean;
627
+ dtls_local_port?: number;
628
+ compression_disabled?: boolean;
629
+ compression_mode?: "stateless" | "all";
630
+ ipv6_disabled?: boolean;
631
+ http_keepalive_disabled?: boolean;
632
+ xml_post_disabled?: boolean;
633
+ external_auth_disabled?: boolean;
634
+ password_authentication_disabled?: boolean;
635
+ tcp_keep_alive_enabled?: boolean;
636
+ pfs?: boolean;
637
+ mtu?: number;
638
+ base_mtu?: number;
639
+ dpd_interval?: Duration;
640
+ reconnect_timeout?: Duration;
641
+ trojan_interval?: Duration;
642
+ queue_length?: number;
643
+ allow_insecure_crypto?: boolean;
644
+ tls?: OpenConnectTLSOptions;
645
+ form_entries?: OpenConnectFormEntryOptions[];
646
+ } | {
647
+ type: "openvpn-client";
648
+ tag?: string;
649
+ detour?: string;
650
+ bind_interface?: string;
651
+ inet4_bind_address?: string;
652
+ inet6_bind_address?: string;
653
+ bind_address_no_port?: boolean;
654
+ protect_path?: string;
655
+ routing_mark?: number | string;
656
+ reuse_addr?: boolean;
657
+ netns?: string;
658
+ connect_timeout?: Duration;
659
+ tcp_fast_open?: boolean;
660
+ tcp_multi_path?: boolean;
661
+ disable_tcp_keep_alive?: boolean;
662
+ tcp_keep_alive?: Duration;
663
+ tcp_keep_alive_interval?: Duration;
664
+ udp_fragment?: boolean;
665
+ domain_resolver?: DomainResolver$1;
666
+ network_strategy?: "default" | "fallback" | "hybrid";
667
+ network_type?: InterfaceType | InterfaceType[];
668
+ fallback_network_type?: InterfaceType | InterfaceType[];
669
+ fallback_delay?: Duration;
670
+ server?: string;
671
+ server_port?: number;
672
+ system?: boolean;
673
+ name?: string;
674
+ mtu?: number;
675
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
676
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
677
+ udp_nat_max?: number;
678
+ mode?: "tls" | "static_key";
679
+ network?: "udp" | "udp4" | "udp6" | "tcp" | "tcp4" | "tcp6";
680
+ servers?: OpenVPNRemoteOptions[];
681
+ remote_random?: boolean;
682
+ address?: string | string[];
683
+ peer_address?: string;
684
+ peer_address_ipv6?: string;
685
+ topology?: "net30" | "p2p" | "subnet";
686
+ username?: string;
687
+ password?: string;
688
+ auth_retry?: "none" | "nointeract" | "interact";
689
+ static_challenge?: string;
690
+ static_challenge_echo?: boolean;
691
+ static_key?: string | string[];
692
+ static_key_path?: string;
693
+ key_direction?: "server" | "client";
694
+ tls?: OpenVPNOutboundTLSOptions;
695
+ cipher?: string;
696
+ data_ciphers?: string | string[];
697
+ data_ciphers_fallback?: string;
698
+ auth?: string;
699
+ mss_fix?: number;
700
+ mss_fix_disabled?: boolean;
701
+ mss_fix_mode?: "mtu" | "fixed";
702
+ fragment?: number;
703
+ replay_window?: number;
704
+ replay_window_time?: Duration;
705
+ compression?: "none" | "no" | "lz4" | "lz4-v2" | "stub" | "stub-v2" | "disabled" | "off";
706
+ compression_lzo?: "none" | "no" | "yes" | "adaptive" | "asym" | "disabled" | "off";
707
+ allow_compression?: "no" | "asym" | "yes";
708
+ route_no_pull?: boolean;
709
+ pull_filters?: OpenVPNPullFilterOptions[];
710
+ routes?: string | string[];
711
+ route_gateway?: string;
712
+ route_metric?: number;
713
+ redirect_gateway?: boolean;
714
+ redirect_gateway_flags?: string | string[];
715
+ redirect_private?: boolean;
716
+ block_ipv6?: boolean;
717
+ ping_interval?: Duration;
718
+ ping_restart?: Duration;
719
+ ping_restart_disabled?: boolean;
720
+ renegotiate_interval?: Duration;
721
+ renegotiate_disabled?: boolean;
722
+ renegotiate_bytes?: number;
723
+ renegotiate_packets?: number;
724
+ tls_timeout?: Duration;
725
+ handshake_window?: Duration;
726
+ explicit_exit_notify?: number;
727
+ udp_timeout?: UDPTimeout;
728
+ } | {
729
+ type: "openvpn-server";
730
+ tag?: string;
731
+ listen?: string;
732
+ listen_port?: number;
733
+ bind_interface?: string;
734
+ routing_mark?: number | string;
735
+ reuse_addr?: boolean;
736
+ netns?: string;
737
+ disable_tcp_keep_alive?: boolean;
738
+ tcp_keep_alive?: Duration;
739
+ tcp_keep_alive_interval?: Duration;
740
+ tcp_fast_open?: boolean;
741
+ tcp_multi_path?: boolean;
742
+ udp_fragment?: boolean;
743
+ udp_timeout?: UDPTimeout;
744
+ detour?: string;
745
+ system?: boolean;
746
+ name?: string;
747
+ mtu?: number;
748
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
749
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
750
+ udp_nat_max?: number;
751
+ mode?: "tls" | "static_key";
752
+ network?: "tcp" | "udp";
753
+ remote?: string;
754
+ remote_port?: number;
755
+ max_clients?: number;
756
+ address?: string | string[];
757
+ peer_address?: string;
758
+ peer_address_ipv6?: string;
759
+ topology?: "net30" | "p2p" | "subnet";
760
+ duplicate_cn?: boolean;
761
+ users?: User$1[];
762
+ static_key?: string | string[];
763
+ static_key_path?: string;
764
+ key_direction?: "server" | "client";
765
+ tls?: OpenVPNInboundTLSOptions;
766
+ cipher?: string;
767
+ data_ciphers?: string | string[];
768
+ data_ciphers_fallback?: string;
769
+ auth?: string;
770
+ mss_fix?: number;
771
+ mss_fix_disabled?: boolean;
772
+ mss_fix_mode?: "mtu" | "fixed";
773
+ replay_window?: number;
774
+ replay_window_time?: Duration;
775
+ push?: OpenVPNPushOptions;
776
+ ping_interval?: Duration;
777
+ ping_restart?: Duration;
778
+ renegotiate_interval?: Duration;
779
+ renegotiate_disabled?: boolean;
780
+ renegotiate_bytes?: number;
781
+ renegotiate_packets?: number;
782
+ handshake_window?: Duration;
783
+ } | {
784
+ type: "tailscale";
785
+ tag?: string;
786
+ detour?: string;
787
+ bind_interface?: string;
788
+ inet4_bind_address?: string;
789
+ inet6_bind_address?: string;
790
+ bind_address_no_port?: boolean;
791
+ protect_path?: string;
792
+ routing_mark?: number | string;
793
+ reuse_addr?: boolean;
794
+ netns?: string;
795
+ connect_timeout?: Duration;
796
+ tcp_fast_open?: boolean;
797
+ tcp_multi_path?: boolean;
798
+ disable_tcp_keep_alive?: boolean;
799
+ tcp_keep_alive?: Duration;
800
+ tcp_keep_alive_interval?: Duration;
801
+ udp_fragment?: boolean;
802
+ domain_resolver?: DomainResolver$1;
803
+ network_strategy?: "default" | "fallback" | "hybrid";
804
+ network_type?: InterfaceType | InterfaceType[];
805
+ fallback_network_type?: InterfaceType | InterfaceType[];
806
+ fallback_delay?: Duration;
807
+ state_directory?: string;
808
+ auth_key?: string;
809
+ control_url?: string;
810
+ ephemeral?: boolean;
811
+ hostname?: string;
812
+ accept_routes?: boolean;
813
+ exit_node?: string;
814
+ exit_node_allow_lan_access?: boolean;
815
+ advertise_routes?: string[];
816
+ advertise_exit_node?: boolean;
817
+ advertise_tags?: string | string[];
818
+ listen_port?: number;
819
+ relay_server_port?: number;
820
+ relay_server_static_endpoints?: string[];
821
+ system_interface?: boolean;
822
+ system_interface_name?: string;
823
+ system_interface_mtu?: number;
824
+ udp_timeout?: UDPTimeout;
825
+ ssh_server?: boolean | {
826
+ enabled?: boolean;
827
+ disable_pty?: boolean;
828
+ disable_sftp?: boolean;
829
+ disable_forwarding?: boolean;
830
+ };
831
+ taildrop_directory?: string;
832
+ } | {
833
+ type: "wireguard";
834
+ tag?: string;
835
+ system?: boolean;
836
+ name?: string;
837
+ mtu?: number;
838
+ address?: string | string[];
839
+ private_key?: string;
840
+ listen_port?: number;
841
+ peers?: WireGuardPeer[];
842
+ udp_timeout?: Duration;
843
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
844
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
845
+ udp_nat_max?: number;
846
+ workers?: number;
847
+ detour?: string;
848
+ bind_interface?: string;
849
+ inet4_bind_address?: string;
850
+ inet6_bind_address?: string;
851
+ bind_address_no_port?: boolean;
852
+ protect_path?: string;
853
+ routing_mark?: number | string;
854
+ reuse_addr?: boolean;
855
+ netns?: string;
856
+ connect_timeout?: Duration;
857
+ tcp_fast_open?: boolean;
858
+ tcp_multi_path?: boolean;
859
+ disable_tcp_keep_alive?: boolean;
860
+ tcp_keep_alive?: Duration;
861
+ tcp_keep_alive_interval?: Duration;
862
+ udp_fragment?: boolean;
863
+ domain_resolver?: DomainResolver$1;
864
+ network_strategy?: "default" | "fallback" | "hybrid";
865
+ network_type?: InterfaceType | InterfaceType[];
866
+ fallback_network_type?: InterfaceType | InterfaceType[];
867
+ fallback_delay?: Duration;
868
+ };
869
+ type UDPTimeout = number | string;
870
+ type Inbound = {
871
+ type: "anytls";
872
+ tag?: string;
873
+ listen?: string;
874
+ listen_port?: number;
875
+ bind_interface?: string;
876
+ routing_mark?: number | string;
877
+ reuse_addr?: boolean;
878
+ netns?: string;
879
+ disable_tcp_keep_alive?: boolean;
880
+ tcp_keep_alive?: Duration;
881
+ tcp_keep_alive_interval?: Duration;
882
+ tcp_fast_open?: boolean;
883
+ tcp_multi_path?: boolean;
884
+ udp_fragment?: boolean;
885
+ udp_timeout?: UDPTimeout;
886
+ detour?: string;
887
+ tls?: InboundTLSOptions;
888
+ users?: AnyTLSUser[];
889
+ padding_scheme?: string | string[];
890
+ } | {
891
+ type: "cloudflared";
892
+ tag?: string;
893
+ token?: string;
894
+ ha_connections?: number;
895
+ protocol?: "auto" | "quic" | "http2" | "h2mux";
896
+ post_quantum?: boolean;
897
+ edge_ip_version?: 0 | 4 | 6;
898
+ datagram_version?: "v2" | "v3";
899
+ grace_period?: Duration;
900
+ region?: string;
901
+ control_dialer?: DialerOptions;
902
+ tunnel_dialer?: DialerOptions;
903
+ } | {
904
+ type: "direct";
905
+ tag?: string;
906
+ listen?: string;
907
+ listen_port?: number;
908
+ bind_interface?: string;
909
+ routing_mark?: number | string;
910
+ reuse_addr?: boolean;
911
+ netns?: string;
912
+ disable_tcp_keep_alive?: boolean;
913
+ tcp_keep_alive?: Duration;
914
+ tcp_keep_alive_interval?: Duration;
915
+ tcp_fast_open?: boolean;
916
+ tcp_multi_path?: boolean;
917
+ udp_fragment?: boolean;
918
+ udp_timeout?: UDPTimeout;
919
+ detour?: string;
920
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
921
+ override_address?: string;
922
+ override_port?: number;
923
+ } | {
924
+ type: "http";
925
+ tag?: string;
926
+ listen?: string;
927
+ listen_port?: number;
928
+ bind_interface?: string;
929
+ routing_mark?: number | string;
930
+ reuse_addr?: boolean;
931
+ netns?: string;
932
+ disable_tcp_keep_alive?: boolean;
933
+ tcp_keep_alive?: Duration;
934
+ tcp_keep_alive_interval?: Duration;
935
+ tcp_fast_open?: boolean;
936
+ tcp_multi_path?: boolean;
937
+ udp_fragment?: boolean;
938
+ udp_timeout?: UDPTimeout;
939
+ detour?: string;
940
+ users?: User$1[];
941
+ domain_resolver?: DomainResolver$1;
942
+ set_system_proxy?: boolean;
943
+ tls?: InboundTLSOptions;
944
+ } | {
945
+ type: "hysteria";
946
+ tag?: string;
947
+ listen?: string;
948
+ listen_port?: number;
949
+ bind_interface?: string;
950
+ routing_mark?: number | string;
951
+ reuse_addr?: boolean;
952
+ netns?: string;
953
+ disable_tcp_keep_alive?: boolean;
954
+ tcp_keep_alive?: Duration;
955
+ tcp_keep_alive_interval?: Duration;
956
+ tcp_fast_open?: boolean;
957
+ tcp_multi_path?: boolean;
958
+ udp_fragment?: boolean;
959
+ udp_timeout?: UDPTimeout;
960
+ detour?: string;
961
+ up?: number | string;
962
+ up_mbps?: number;
963
+ down?: number | string;
964
+ down_mbps?: number;
965
+ obfs?: string;
966
+ users?: HysteriaUser[];
967
+ tls?: InboundTLSOptions;
968
+ idle_timeout?: Duration;
969
+ keep_alive_period?: Duration;
970
+ stream_receive_window?: number | string;
971
+ connection_receive_window?: number | string;
972
+ max_concurrent_streams?: number;
973
+ initial_packet_size?: number;
974
+ disable_path_mtu_discovery?: boolean;
975
+ } | {
976
+ type: "hysteria2";
977
+ tag?: string;
978
+ listen?: string;
979
+ listen_port?: number;
980
+ bind_interface?: string;
981
+ routing_mark?: number | string;
982
+ reuse_addr?: boolean;
983
+ netns?: string;
984
+ disable_tcp_keep_alive?: boolean;
985
+ tcp_keep_alive?: Duration;
986
+ tcp_keep_alive_interval?: Duration;
987
+ tcp_fast_open?: boolean;
988
+ tcp_multi_path?: boolean;
989
+ udp_fragment?: boolean;
990
+ udp_timeout?: UDPTimeout;
991
+ detour?: string;
992
+ up_mbps?: number;
993
+ down_mbps?: number;
994
+ obfs?: {
995
+ type: "salamander";
996
+ password?: string;
997
+ } | {
998
+ type: "gecko";
999
+ password?: string;
1000
+ min_packet_size?: number;
1001
+ max_packet_size?: number;
1002
+ };
1003
+ users?: Hysteria2User[];
1004
+ ignore_client_bandwidth?: boolean;
1005
+ tls?: InboundTLSOptions;
1006
+ idle_timeout?: Duration;
1007
+ keep_alive_period?: Duration;
1008
+ stream_receive_window?: number | string;
1009
+ connection_receive_window?: number | string;
1010
+ max_concurrent_streams?: number;
1011
+ initial_packet_size?: number;
1012
+ disable_path_mtu_discovery?: boolean;
1013
+ masquerade?: string | ({
1014
+ type: "file";
1015
+ directory?: string;
1016
+ } | {
1017
+ type: "proxy";
1018
+ url?: string;
1019
+ rewrite_host?: boolean;
1020
+ } | {
1021
+ type: "string";
1022
+ status_code?: number;
1023
+ headers?: HTTPHeader;
1024
+ content?: string;
1025
+ });
1026
+ bbr_profile?: "standard" | "conservative" | "aggressive";
1027
+ brutal_debug?: boolean;
1028
+ realm?: Hysteria2InboundRealm;
1029
+ } | {
1030
+ type: "mixed";
1031
+ tag?: string;
1032
+ listen?: string;
1033
+ listen_port?: number;
1034
+ bind_interface?: string;
1035
+ routing_mark?: number | string;
1036
+ reuse_addr?: boolean;
1037
+ netns?: string;
1038
+ disable_tcp_keep_alive?: boolean;
1039
+ tcp_keep_alive?: Duration;
1040
+ tcp_keep_alive_interval?: Duration;
1041
+ tcp_fast_open?: boolean;
1042
+ tcp_multi_path?: boolean;
1043
+ udp_fragment?: boolean;
1044
+ udp_timeout?: UDPTimeout;
1045
+ detour?: string;
1046
+ users?: User$1[];
1047
+ domain_resolver?: DomainResolver$1;
1048
+ set_system_proxy?: boolean;
1049
+ tls?: InboundTLSOptions;
1050
+ } | {
1051
+ type: "naive";
1052
+ tag?: string;
1053
+ listen?: string;
1054
+ listen_port?: number;
1055
+ bind_interface?: string;
1056
+ routing_mark?: number | string;
1057
+ reuse_addr?: boolean;
1058
+ netns?: string;
1059
+ disable_tcp_keep_alive?: boolean;
1060
+ tcp_keep_alive?: Duration;
1061
+ tcp_keep_alive_interval?: Duration;
1062
+ tcp_fast_open?: boolean;
1063
+ tcp_multi_path?: boolean;
1064
+ udp_fragment?: boolean;
1065
+ udp_timeout?: UDPTimeout;
1066
+ detour?: string;
1067
+ users?: User$1[];
1068
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1069
+ quic_congestion_control?: "bbr" | "cubic" | "reno";
1070
+ tls?: InboundTLSOptions;
1071
+ } | {
1072
+ type: "redirect";
1073
+ tag?: string;
1074
+ listen?: string;
1075
+ listen_port?: number;
1076
+ bind_interface?: string;
1077
+ routing_mark?: number | string;
1078
+ reuse_addr?: boolean;
1079
+ netns?: string;
1080
+ disable_tcp_keep_alive?: boolean;
1081
+ tcp_keep_alive?: Duration;
1082
+ tcp_keep_alive_interval?: Duration;
1083
+ tcp_fast_open?: boolean;
1084
+ tcp_multi_path?: boolean;
1085
+ udp_fragment?: boolean;
1086
+ udp_timeout?: UDPTimeout;
1087
+ detour?: string;
1088
+ } | {
1089
+ type: "shadowsocks";
1090
+ tag?: string;
1091
+ listen?: string;
1092
+ listen_port?: number;
1093
+ bind_interface?: string;
1094
+ routing_mark?: number | string;
1095
+ reuse_addr?: boolean;
1096
+ netns?: string;
1097
+ disable_tcp_keep_alive?: boolean;
1098
+ tcp_keep_alive?: Duration;
1099
+ tcp_keep_alive_interval?: Duration;
1100
+ tcp_fast_open?: boolean;
1101
+ tcp_multi_path?: boolean;
1102
+ udp_fragment?: boolean;
1103
+ udp_timeout?: UDPTimeout;
1104
+ detour?: string;
1105
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1106
+ method?: "none" | "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm" | "chacha20-ietf-poly1305" | "xchacha20-ietf-poly1305" | "2022-blake3-aes-128-gcm" | "2022-blake3-aes-256-gcm" | "2022-blake3-chacha20-poly1305";
1107
+ password?: string;
1108
+ users?: ShadowsocksUser[];
1109
+ destinations?: ShadowsocksDestination[];
1110
+ multiplex?: InboundMultiplexOptions;
1111
+ managed?: boolean;
1112
+ } | {
1113
+ type: "shadowtls";
1114
+ tag?: string;
1115
+ listen?: string;
1116
+ listen_port?: number;
1117
+ bind_interface?: string;
1118
+ routing_mark?: number | string;
1119
+ reuse_addr?: boolean;
1120
+ netns?: string;
1121
+ disable_tcp_keep_alive?: boolean;
1122
+ tcp_keep_alive?: Duration;
1123
+ tcp_keep_alive_interval?: Duration;
1124
+ tcp_fast_open?: boolean;
1125
+ tcp_multi_path?: boolean;
1126
+ udp_fragment?: boolean;
1127
+ udp_timeout?: UDPTimeout;
1128
+ detour?: string;
1129
+ version?: 1 | 2 | 3;
1130
+ password?: string;
1131
+ users?: ShadowTLSUser[];
1132
+ handshake?: ShadowTLSHandshakeOptions;
1133
+ handshake_for_server_name?: {
1134
+ [k: string]: ShadowTLSHandshakeOptions;
1135
+ };
1136
+ strict_mode?: boolean;
1137
+ wildcard_sni?: "" | "off" | "authed" | "all";
1138
+ } | ({
1139
+ type: "snell";
1140
+ tag?: string;
1141
+ version: 5;
1142
+ listen?: string;
1143
+ listen_port?: number;
1144
+ bind_interface?: string;
1145
+ routing_mark?: number | string;
1146
+ reuse_addr?: boolean;
1147
+ netns?: string;
1148
+ disable_tcp_keep_alive?: boolean;
1149
+ tcp_keep_alive?: Duration;
1150
+ tcp_keep_alive_interval?: Duration;
1151
+ tcp_fast_open?: boolean;
1152
+ tcp_multi_path?: boolean;
1153
+ udp_fragment?: boolean;
1154
+ udp_timeout?: UDPTimeout;
1155
+ detour?: string;
1156
+ psk?: string;
1157
+ users?: SnellUser[];
1158
+ obfs_mode?: "none" | "http" | "tls";
1159
+ } | {
1160
+ type: "snell";
1161
+ tag?: string;
1162
+ version: 6;
1163
+ listen?: string;
1164
+ listen_port?: number;
1165
+ bind_interface?: string;
1166
+ routing_mark?: number | string;
1167
+ reuse_addr?: boolean;
1168
+ netns?: string;
1169
+ disable_tcp_keep_alive?: boolean;
1170
+ tcp_keep_alive?: Duration;
1171
+ tcp_keep_alive_interval?: Duration;
1172
+ tcp_fast_open?: boolean;
1173
+ tcp_multi_path?: boolean;
1174
+ udp_fragment?: boolean;
1175
+ udp_timeout?: UDPTimeout;
1176
+ detour?: string;
1177
+ psk?: string;
1178
+ users?: SnellUser[];
1179
+ mode?: "default" | "unshaped" | "unsafe-raw";
1180
+ }) | {
1181
+ type: "socks";
1182
+ tag?: string;
1183
+ listen?: string;
1184
+ listen_port?: number;
1185
+ bind_interface?: string;
1186
+ routing_mark?: number | string;
1187
+ reuse_addr?: boolean;
1188
+ netns?: string;
1189
+ disable_tcp_keep_alive?: boolean;
1190
+ tcp_keep_alive?: Duration;
1191
+ tcp_keep_alive_interval?: Duration;
1192
+ tcp_fast_open?: boolean;
1193
+ tcp_multi_path?: boolean;
1194
+ udp_fragment?: boolean;
1195
+ udp_timeout?: UDPTimeout;
1196
+ detour?: string;
1197
+ users?: User$1[];
1198
+ domain_resolver?: DomainResolver$1;
1199
+ } | {
1200
+ type: "tproxy";
1201
+ tag?: string;
1202
+ listen?: string;
1203
+ listen_port?: number;
1204
+ bind_interface?: string;
1205
+ routing_mark?: number | string;
1206
+ reuse_addr?: boolean;
1207
+ netns?: string;
1208
+ disable_tcp_keep_alive?: boolean;
1209
+ tcp_keep_alive?: Duration;
1210
+ tcp_keep_alive_interval?: Duration;
1211
+ tcp_fast_open?: boolean;
1212
+ tcp_multi_path?: boolean;
1213
+ udp_fragment?: boolean;
1214
+ udp_timeout?: UDPTimeout;
1215
+ detour?: string;
1216
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1217
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1218
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1219
+ udp_nat_max?: number;
1220
+ } | {
1221
+ type: "trojan";
1222
+ tag?: string;
1223
+ listen?: string;
1224
+ listen_port?: number;
1225
+ bind_interface?: string;
1226
+ routing_mark?: number | string;
1227
+ reuse_addr?: boolean;
1228
+ netns?: string;
1229
+ disable_tcp_keep_alive?: boolean;
1230
+ tcp_keep_alive?: Duration;
1231
+ tcp_keep_alive_interval?: Duration;
1232
+ tcp_fast_open?: boolean;
1233
+ tcp_multi_path?: boolean;
1234
+ udp_fragment?: boolean;
1235
+ udp_timeout?: UDPTimeout;
1236
+ detour?: string;
1237
+ users?: TrojanUser[];
1238
+ tls?: InboundTLSOptions;
1239
+ fallback?: ServerOptions;
1240
+ fallback_for_alpn?: {
1241
+ [k: string]: ServerOptions;
1242
+ };
1243
+ multiplex?: InboundMultiplexOptions;
1244
+ transport?: V2RayTransport;
1245
+ } | {
1246
+ type: "tuic";
1247
+ tag?: string;
1248
+ listen?: string;
1249
+ listen_port?: number;
1250
+ bind_interface?: string;
1251
+ routing_mark?: number | string;
1252
+ reuse_addr?: boolean;
1253
+ netns?: string;
1254
+ disable_tcp_keep_alive?: boolean;
1255
+ tcp_keep_alive?: Duration;
1256
+ tcp_keep_alive_interval?: Duration;
1257
+ tcp_fast_open?: boolean;
1258
+ tcp_multi_path?: boolean;
1259
+ udp_fragment?: boolean;
1260
+ udp_timeout?: UDPTimeout;
1261
+ detour?: string;
1262
+ users?: TUICUser[];
1263
+ congestion_control?: "cubic" | "new_reno" | "bbr";
1264
+ auth_timeout?: Duration;
1265
+ zero_rtt_handshake?: boolean;
1266
+ heartbeat?: Duration;
1267
+ tls?: InboundTLSOptions;
1268
+ idle_timeout?: Duration;
1269
+ keep_alive_period?: Duration;
1270
+ stream_receive_window?: number | string;
1271
+ connection_receive_window?: number | string;
1272
+ max_concurrent_streams?: number;
1273
+ initial_packet_size?: number;
1274
+ disable_path_mtu_discovery?: boolean;
1275
+ } | {
1276
+ type: "tun";
1277
+ tag?: string;
1278
+ interface_name?: string;
1279
+ netns?: string;
1280
+ mtu?: number;
1281
+ address?: string | string[];
1282
+ dns_mode?: "disabled" | "native" | "hijack";
1283
+ dns_address?: string | string[];
1284
+ auto_route?: boolean;
1285
+ iproute2_table_index?: number;
1286
+ iproute2_rule_index?: number;
1287
+ auto_redirect?: boolean;
1288
+ auto_redirect_input_mark?: number | string;
1289
+ auto_redirect_output_mark?: number | string;
1290
+ auto_redirect_reset_mark?: number | string;
1291
+ auto_redirect_nfqueue?: number;
1292
+ auto_redirect_iproute2_fallback_rule_index?: number;
1293
+ exclude_mptcp?: boolean;
1294
+ loopback_address?: string | string[];
1295
+ strict_route?: boolean;
1296
+ route_address?: string | string[];
1297
+ route_address_set?: string | string[];
1298
+ route_exclude_address?: string | string[];
1299
+ route_exclude_address_set?: string | string[];
1300
+ include_interface?: string | string[];
1301
+ exclude_interface?: string | string[];
1302
+ include_uid?: number | number[];
1303
+ include_uid_range?: string | string[];
1304
+ exclude_uid?: number | number[];
1305
+ exclude_uid_range?: string | string[];
1306
+ include_android_user?: number | number[];
1307
+ include_package?: string | string[];
1308
+ exclude_package?: string | string[];
1309
+ include_mac_address?: string | string[];
1310
+ exclude_mac_address?: string | string[];
1311
+ udp_timeout?: UDPTimeout;
1312
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1313
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1314
+ udp_nat_max?: number;
1315
+ stack?: "system" | "gvisor" | "mixed";
1316
+ platform?: TunPlatformOptions;
1317
+ } | {
1318
+ type: "vless";
1319
+ tag?: string;
1320
+ listen?: string;
1321
+ listen_port?: number;
1322
+ bind_interface?: string;
1323
+ routing_mark?: number | string;
1324
+ reuse_addr?: boolean;
1325
+ netns?: string;
1326
+ disable_tcp_keep_alive?: boolean;
1327
+ tcp_keep_alive?: Duration;
1328
+ tcp_keep_alive_interval?: Duration;
1329
+ tcp_fast_open?: boolean;
1330
+ tcp_multi_path?: boolean;
1331
+ udp_fragment?: boolean;
1332
+ udp_timeout?: UDPTimeout;
1333
+ detour?: string;
1334
+ users?: VLESSUser[];
1335
+ tls?: InboundTLSOptions;
1336
+ multiplex?: InboundMultiplexOptions;
1337
+ transport?: V2RayTransport;
1338
+ } | {
1339
+ type: "vmess";
1340
+ tag?: string;
1341
+ listen?: string;
1342
+ listen_port?: number;
1343
+ bind_interface?: string;
1344
+ routing_mark?: number | string;
1345
+ reuse_addr?: boolean;
1346
+ netns?: string;
1347
+ disable_tcp_keep_alive?: boolean;
1348
+ tcp_keep_alive?: Duration;
1349
+ tcp_keep_alive_interval?: Duration;
1350
+ tcp_fast_open?: boolean;
1351
+ tcp_multi_path?: boolean;
1352
+ udp_fragment?: boolean;
1353
+ udp_timeout?: UDPTimeout;
1354
+ detour?: string;
1355
+ users?: VMessUser[];
1356
+ tls?: InboundTLSOptions;
1357
+ multiplex?: InboundMultiplexOptions;
1358
+ transport?: V2RayTransport;
1359
+ };
1360
+ type CertificateProviderReference = string | ({
1361
+ type: "acme";
1362
+ domain?: string | string[];
1363
+ data_directory?: string;
1364
+ default_server_name?: string;
1365
+ email?: string;
1366
+ provider?: string;
1367
+ account_key?: string;
1368
+ disable_http_challenge?: boolean;
1369
+ disable_tls_alpn_challenge?: boolean;
1370
+ alternative_http_port?: number;
1371
+ alternative_tls_port?: number;
1372
+ external_account?: ACMEExternalAccountOptions;
1373
+ dns01_challenge?: ACMEProviderDNS01Challenge;
1374
+ key_type?: "ed25519" | "p256" | "p384" | "rsa2048" | "rsa4096";
1375
+ profile?: string;
1376
+ http_client?: HTTPClientReference;
1377
+ } | {
1378
+ type: "cloudflare-origin-ca";
1379
+ domain?: string | string[];
1380
+ data_directory?: string;
1381
+ api_token?: string;
1382
+ origin_ca_key?: string;
1383
+ request_type?: "origin-rsa" | "origin-ecc";
1384
+ requested_validity?: 0 | 7 | 30 | 90 | 365 | 730 | 1095 | 5475;
1385
+ http_client?: HTTPClientReference;
1386
+ } | {
1387
+ type: "tailscale";
1388
+ endpoint?: string;
1389
+ });
1390
+ type V2RayTransport = {
1391
+ type: "http";
1392
+ host?: string | string[];
1393
+ path?: string;
1394
+ method?: string;
1395
+ headers?: HTTPHeader;
1396
+ idle_timeout?: Duration;
1397
+ ping_timeout?: Duration;
1398
+ } | {
1399
+ type: "ws";
1400
+ path?: string;
1401
+ headers?: HTTPHeader;
1402
+ max_early_data?: number;
1403
+ early_data_header_name?: string;
1404
+ } | {
1405
+ type: "quic";
1406
+ } | {
1407
+ type: "grpc";
1408
+ service_name?: string;
1409
+ idle_timeout?: Duration;
1410
+ ping_timeout?: Duration;
1411
+ permit_without_stream?: boolean;
1412
+ } | {
1413
+ type: "httpupgrade";
1414
+ host?: string;
1415
+ path?: string;
1416
+ headers?: HTTPHeader;
1417
+ };
1418
+ type Outbound = {
1419
+ type: "anytls";
1420
+ tag?: string;
1421
+ detour?: string;
1422
+ bind_interface?: string;
1423
+ inet4_bind_address?: string;
1424
+ inet6_bind_address?: string;
1425
+ bind_address_no_port?: boolean;
1426
+ protect_path?: string;
1427
+ routing_mark?: number | string;
1428
+ reuse_addr?: boolean;
1429
+ netns?: string;
1430
+ connect_timeout?: Duration;
1431
+ tcp_fast_open?: boolean;
1432
+ tcp_multi_path?: boolean;
1433
+ disable_tcp_keep_alive?: boolean;
1434
+ tcp_keep_alive?: Duration;
1435
+ tcp_keep_alive_interval?: Duration;
1436
+ udp_fragment?: boolean;
1437
+ domain_resolver?: DomainResolver$1;
1438
+ network_strategy?: "default" | "fallback" | "hybrid";
1439
+ network_type?: InterfaceType | InterfaceType[];
1440
+ fallback_network_type?: InterfaceType | InterfaceType[];
1441
+ fallback_delay?: Duration;
1442
+ server?: string;
1443
+ server_port?: number;
1444
+ tls?: OutboundTLSOptions;
1445
+ password?: string;
1446
+ idle_session_check_interval?: Duration;
1447
+ idle_session_timeout?: Duration;
1448
+ min_idle_session?: number;
1449
+ client_metadata?: string;
1450
+ } | {
1451
+ type: "block";
1452
+ tag?: string;
1453
+ } | {
1454
+ type: "bridge";
1455
+ tag?: string;
1456
+ interface?: string;
1457
+ bridge_name?: string;
1458
+ iproute2_table_index?: number;
1459
+ iproute2_rule_index?: number;
1460
+ } | {
1461
+ type: "direct";
1462
+ tag?: string;
1463
+ detour?: string;
1464
+ bind_interface?: string;
1465
+ inet4_bind_address?: string;
1466
+ inet6_bind_address?: string;
1467
+ bind_address_no_port?: boolean;
1468
+ protect_path?: string;
1469
+ routing_mark?: number | string;
1470
+ reuse_addr?: boolean;
1471
+ netns?: string;
1472
+ connect_timeout?: Duration;
1473
+ tcp_fast_open?: boolean;
1474
+ tcp_multi_path?: boolean;
1475
+ disable_tcp_keep_alive?: boolean;
1476
+ tcp_keep_alive?: Duration;
1477
+ tcp_keep_alive_interval?: Duration;
1478
+ udp_fragment?: boolean;
1479
+ domain_resolver?: DomainResolver$1;
1480
+ network_strategy?: "default" | "fallback" | "hybrid";
1481
+ network_type?: InterfaceType | InterfaceType[];
1482
+ fallback_network_type?: InterfaceType | InterfaceType[];
1483
+ fallback_delay?: Duration;
1484
+ } | {
1485
+ type: "http";
1486
+ tag?: string;
1487
+ detour?: string;
1488
+ bind_interface?: string;
1489
+ inet4_bind_address?: string;
1490
+ inet6_bind_address?: string;
1491
+ bind_address_no_port?: boolean;
1492
+ protect_path?: string;
1493
+ routing_mark?: number | string;
1494
+ reuse_addr?: boolean;
1495
+ netns?: string;
1496
+ connect_timeout?: Duration;
1497
+ tcp_fast_open?: boolean;
1498
+ tcp_multi_path?: boolean;
1499
+ disable_tcp_keep_alive?: boolean;
1500
+ tcp_keep_alive?: Duration;
1501
+ tcp_keep_alive_interval?: Duration;
1502
+ udp_fragment?: boolean;
1503
+ domain_resolver?: DomainResolver$1;
1504
+ network_strategy?: "default" | "fallback" | "hybrid";
1505
+ network_type?: InterfaceType | InterfaceType[];
1506
+ fallback_network_type?: InterfaceType | InterfaceType[];
1507
+ fallback_delay?: Duration;
1508
+ server?: string;
1509
+ server_port?: number;
1510
+ username?: string;
1511
+ password?: string;
1512
+ tls?: OutboundTLSOptions;
1513
+ path?: string;
1514
+ headers?: HTTPHeader;
1515
+ } | {
1516
+ type: "hysteria";
1517
+ tag?: string;
1518
+ detour?: string;
1519
+ bind_interface?: string;
1520
+ inet4_bind_address?: string;
1521
+ inet6_bind_address?: string;
1522
+ bind_address_no_port?: boolean;
1523
+ protect_path?: string;
1524
+ routing_mark?: number | string;
1525
+ reuse_addr?: boolean;
1526
+ netns?: string;
1527
+ connect_timeout?: Duration;
1528
+ tcp_fast_open?: boolean;
1529
+ tcp_multi_path?: boolean;
1530
+ disable_tcp_keep_alive?: boolean;
1531
+ tcp_keep_alive?: Duration;
1532
+ tcp_keep_alive_interval?: Duration;
1533
+ udp_fragment?: boolean;
1534
+ domain_resolver?: DomainResolver$1;
1535
+ network_strategy?: "default" | "fallback" | "hybrid";
1536
+ network_type?: InterfaceType | InterfaceType[];
1537
+ fallback_network_type?: InterfaceType | InterfaceType[];
1538
+ fallback_delay?: Duration;
1539
+ server?: string;
1540
+ server_port?: number;
1541
+ server_ports?: string | string[];
1542
+ hop_interval?: Duration;
1543
+ up?: number | string;
1544
+ up_mbps?: number;
1545
+ down?: number | string;
1546
+ down_mbps?: number;
1547
+ obfs?: string;
1548
+ auth?: string | number[];
1549
+ auth_str?: string;
1550
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1551
+ tls?: OutboundTLSOptions;
1552
+ idle_timeout?: Duration;
1553
+ keep_alive_period?: Duration;
1554
+ stream_receive_window?: number | string;
1555
+ connection_receive_window?: number | string;
1556
+ max_concurrent_streams?: number;
1557
+ initial_packet_size?: number;
1558
+ disable_path_mtu_discovery?: boolean;
1559
+ } | {
1560
+ type: "hysteria2";
1561
+ tag?: string;
1562
+ detour?: string;
1563
+ bind_interface?: string;
1564
+ inet4_bind_address?: string;
1565
+ inet6_bind_address?: string;
1566
+ bind_address_no_port?: boolean;
1567
+ protect_path?: string;
1568
+ routing_mark?: number | string;
1569
+ reuse_addr?: boolean;
1570
+ netns?: string;
1571
+ connect_timeout?: Duration;
1572
+ tcp_fast_open?: boolean;
1573
+ tcp_multi_path?: boolean;
1574
+ disable_tcp_keep_alive?: boolean;
1575
+ tcp_keep_alive?: Duration;
1576
+ tcp_keep_alive_interval?: Duration;
1577
+ udp_fragment?: boolean;
1578
+ domain_resolver?: DomainResolver$1;
1579
+ network_strategy?: "default" | "fallback" | "hybrid";
1580
+ network_type?: InterfaceType | InterfaceType[];
1581
+ fallback_network_type?: InterfaceType | InterfaceType[];
1582
+ fallback_delay?: Duration;
1583
+ server?: string;
1584
+ server_port?: number;
1585
+ server_ports?: string | string[];
1586
+ hop_interval?: Duration;
1587
+ hop_interval_max?: Duration;
1588
+ up_mbps?: number;
1589
+ down_mbps?: number;
1590
+ obfs?: {
1591
+ type: "salamander";
1592
+ password?: string;
1593
+ } | {
1594
+ type: "gecko";
1595
+ password?: string;
1596
+ min_packet_size?: number;
1597
+ max_packet_size?: number;
1598
+ };
1599
+ password?: string;
1600
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1601
+ tls?: OutboundTLSOptions;
1602
+ idle_timeout?: Duration;
1603
+ keep_alive_period?: Duration;
1604
+ stream_receive_window?: number | string;
1605
+ connection_receive_window?: number | string;
1606
+ max_concurrent_streams?: number;
1607
+ initial_packet_size?: number;
1608
+ disable_path_mtu_discovery?: boolean;
1609
+ bbr_profile?: "standard" | "conservative" | "aggressive";
1610
+ brutal_debug?: boolean;
1611
+ disable_chrome_parrot?: boolean;
1612
+ realm?: Hysteria2Realm;
1613
+ } | {
1614
+ type: "naive";
1615
+ tag?: string;
1616
+ detour?: string;
1617
+ bind_interface?: string;
1618
+ inet4_bind_address?: string;
1619
+ inet6_bind_address?: string;
1620
+ bind_address_no_port?: boolean;
1621
+ protect_path?: string;
1622
+ routing_mark?: number | string;
1623
+ reuse_addr?: boolean;
1624
+ netns?: string;
1625
+ connect_timeout?: Duration;
1626
+ tcp_fast_open?: boolean;
1627
+ tcp_multi_path?: boolean;
1628
+ disable_tcp_keep_alive?: boolean;
1629
+ tcp_keep_alive?: Duration;
1630
+ tcp_keep_alive_interval?: Duration;
1631
+ udp_fragment?: boolean;
1632
+ domain_resolver?: DomainResolver$1;
1633
+ network_strategy?: "default" | "fallback" | "hybrid";
1634
+ network_type?: InterfaceType | InterfaceType[];
1635
+ fallback_network_type?: InterfaceType | InterfaceType[];
1636
+ fallback_delay?: Duration;
1637
+ server?: string;
1638
+ server_port?: number;
1639
+ username?: string;
1640
+ password?: string;
1641
+ insecure_concurrency?: number;
1642
+ extra_headers?: HTTPHeader;
1643
+ stream_receive_window?: number | string;
1644
+ udp_over_tcp?: boolean | {
1645
+ enabled?: boolean;
1646
+ version?: 1 | 2;
1647
+ };
1648
+ quic?: boolean;
1649
+ quic_congestion_control?: "bbr" | "bbr2" | "cubic" | "reno";
1650
+ quic_session_receive_window?: number | string;
1651
+ tls?: OutboundTLSOptions;
1652
+ } | {
1653
+ type: "selector";
1654
+ tag?: string;
1655
+ outbounds?: string[];
1656
+ default?: string;
1657
+ interrupt_exist_connections?: boolean;
1658
+ } | {
1659
+ type: "shadowsocks";
1660
+ tag?: string;
1661
+ detour?: string;
1662
+ bind_interface?: string;
1663
+ inet4_bind_address?: string;
1664
+ inet6_bind_address?: string;
1665
+ bind_address_no_port?: boolean;
1666
+ protect_path?: string;
1667
+ routing_mark?: number | string;
1668
+ reuse_addr?: boolean;
1669
+ netns?: string;
1670
+ connect_timeout?: Duration;
1671
+ tcp_fast_open?: boolean;
1672
+ tcp_multi_path?: boolean;
1673
+ disable_tcp_keep_alive?: boolean;
1674
+ tcp_keep_alive?: Duration;
1675
+ tcp_keep_alive_interval?: Duration;
1676
+ udp_fragment?: boolean;
1677
+ domain_resolver?: DomainResolver$1;
1678
+ network_strategy?: "default" | "fallback" | "hybrid";
1679
+ network_type?: InterfaceType | InterfaceType[];
1680
+ fallback_network_type?: InterfaceType | InterfaceType[];
1681
+ fallback_delay?: Duration;
1682
+ server?: string;
1683
+ server_port?: number;
1684
+ method?: "none" | "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm" | "chacha20-ietf-poly1305" | "xchacha20-ietf-poly1305" | "2022-blake3-aes-128-gcm" | "2022-blake3-aes-256-gcm" | "2022-blake3-chacha20-poly1305" | "aes-128-ctr" | "aes-192-ctr" | "aes-256-ctr" | "aes-128-cfb" | "aes-192-cfb" | "aes-256-cfb" | "rc4-md5" | "chacha20-ietf" | "xchacha20";
1685
+ password?: string;
1686
+ plugin?: string;
1687
+ plugin_opts?: string;
1688
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1689
+ udp_over_tcp?: boolean | {
1690
+ enabled?: boolean;
1691
+ version?: 1 | 2;
1692
+ };
1693
+ multiplex?: OutboundMultiplexOptions;
1694
+ } | {
1695
+ type: "shadowtls";
1696
+ tag?: string;
1697
+ detour?: string;
1698
+ bind_interface?: string;
1699
+ inet4_bind_address?: string;
1700
+ inet6_bind_address?: string;
1701
+ bind_address_no_port?: boolean;
1702
+ protect_path?: string;
1703
+ routing_mark?: number | string;
1704
+ reuse_addr?: boolean;
1705
+ netns?: string;
1706
+ connect_timeout?: Duration;
1707
+ tcp_fast_open?: boolean;
1708
+ tcp_multi_path?: boolean;
1709
+ disable_tcp_keep_alive?: boolean;
1710
+ tcp_keep_alive?: Duration;
1711
+ tcp_keep_alive_interval?: Duration;
1712
+ udp_fragment?: boolean;
1713
+ domain_resolver?: DomainResolver$1;
1714
+ network_strategy?: "default" | "fallback" | "hybrid";
1715
+ network_type?: InterfaceType | InterfaceType[];
1716
+ fallback_network_type?: InterfaceType | InterfaceType[];
1717
+ fallback_delay?: Duration;
1718
+ server?: string;
1719
+ server_port?: number;
1720
+ version?: 1 | 2 | 3;
1721
+ password?: string;
1722
+ tls?: OutboundTLSOptions;
1723
+ } | ({
1724
+ type: "snell";
1725
+ tag?: string;
1726
+ version: 4;
1727
+ detour?: string;
1728
+ bind_interface?: string;
1729
+ inet4_bind_address?: string;
1730
+ inet6_bind_address?: string;
1731
+ bind_address_no_port?: boolean;
1732
+ protect_path?: string;
1733
+ routing_mark?: number | string;
1734
+ reuse_addr?: boolean;
1735
+ netns?: string;
1736
+ connect_timeout?: Duration;
1737
+ tcp_fast_open?: boolean;
1738
+ tcp_multi_path?: boolean;
1739
+ disable_tcp_keep_alive?: boolean;
1740
+ tcp_keep_alive?: Duration;
1741
+ tcp_keep_alive_interval?: Duration;
1742
+ udp_fragment?: boolean;
1743
+ domain_resolver?: DomainResolver$1;
1744
+ network_strategy?: "default" | "fallback" | "hybrid";
1745
+ network_type?: InterfaceType | InterfaceType[];
1746
+ fallback_network_type?: InterfaceType | InterfaceType[];
1747
+ fallback_delay?: Duration;
1748
+ server?: string;
1749
+ server_port?: number;
1750
+ psk?: string;
1751
+ userkey?: string;
1752
+ reuse?: boolean;
1753
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1754
+ obfs_mode?: "none" | "http" | "tls";
1755
+ obfs_host?: string;
1756
+ } | {
1757
+ type: "snell";
1758
+ tag?: string;
1759
+ version: 6;
1760
+ detour?: string;
1761
+ bind_interface?: string;
1762
+ inet4_bind_address?: string;
1763
+ inet6_bind_address?: string;
1764
+ bind_address_no_port?: boolean;
1765
+ protect_path?: string;
1766
+ routing_mark?: number | string;
1767
+ reuse_addr?: boolean;
1768
+ netns?: string;
1769
+ connect_timeout?: Duration;
1770
+ tcp_fast_open?: boolean;
1771
+ tcp_multi_path?: boolean;
1772
+ disable_tcp_keep_alive?: boolean;
1773
+ tcp_keep_alive?: Duration;
1774
+ tcp_keep_alive_interval?: Duration;
1775
+ udp_fragment?: boolean;
1776
+ domain_resolver?: DomainResolver$1;
1777
+ network_strategy?: "default" | "fallback" | "hybrid";
1778
+ network_type?: InterfaceType | InterfaceType[];
1779
+ fallback_network_type?: InterfaceType | InterfaceType[];
1780
+ fallback_delay?: Duration;
1781
+ server?: string;
1782
+ server_port?: number;
1783
+ psk?: string;
1784
+ userkey?: string;
1785
+ reuse?: boolean;
1786
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1787
+ mode?: "default" | "unshaped" | "unsafe-raw";
1788
+ }) | {
1789
+ type: "socks";
1790
+ tag?: string;
1791
+ detour?: string;
1792
+ bind_interface?: string;
1793
+ inet4_bind_address?: string;
1794
+ inet6_bind_address?: string;
1795
+ bind_address_no_port?: boolean;
1796
+ protect_path?: string;
1797
+ routing_mark?: number | string;
1798
+ reuse_addr?: boolean;
1799
+ netns?: string;
1800
+ connect_timeout?: Duration;
1801
+ tcp_fast_open?: boolean;
1802
+ tcp_multi_path?: boolean;
1803
+ disable_tcp_keep_alive?: boolean;
1804
+ tcp_keep_alive?: Duration;
1805
+ tcp_keep_alive_interval?: Duration;
1806
+ udp_fragment?: boolean;
1807
+ domain_resolver?: DomainResolver$1;
1808
+ network_strategy?: "default" | "fallback" | "hybrid";
1809
+ network_type?: InterfaceType | InterfaceType[];
1810
+ fallback_network_type?: InterfaceType | InterfaceType[];
1811
+ fallback_delay?: Duration;
1812
+ server?: string;
1813
+ server_port?: number;
1814
+ version?: "4" | "4a" | "5";
1815
+ username?: string;
1816
+ password?: string;
1817
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1818
+ udp_over_tcp?: boolean | {
1819
+ enabled?: boolean;
1820
+ version?: 1 | 2;
1821
+ };
1822
+ } | {
1823
+ type: "ssh";
1824
+ tag?: string;
1825
+ detour?: string;
1826
+ bind_interface?: string;
1827
+ inet4_bind_address?: string;
1828
+ inet6_bind_address?: string;
1829
+ bind_address_no_port?: boolean;
1830
+ protect_path?: string;
1831
+ routing_mark?: number | string;
1832
+ reuse_addr?: boolean;
1833
+ netns?: string;
1834
+ connect_timeout?: Duration;
1835
+ tcp_fast_open?: boolean;
1836
+ tcp_multi_path?: boolean;
1837
+ disable_tcp_keep_alive?: boolean;
1838
+ tcp_keep_alive?: Duration;
1839
+ tcp_keep_alive_interval?: Duration;
1840
+ udp_fragment?: boolean;
1841
+ domain_resolver?: DomainResolver$1;
1842
+ network_strategy?: "default" | "fallback" | "hybrid";
1843
+ network_type?: InterfaceType | InterfaceType[];
1844
+ fallback_network_type?: InterfaceType | InterfaceType[];
1845
+ fallback_delay?: Duration;
1846
+ server?: string;
1847
+ server_port?: number;
1848
+ user?: string;
1849
+ password?: string;
1850
+ private_key?: string | string[];
1851
+ private_key_path?: string;
1852
+ private_key_passphrase?: string;
1853
+ host_key?: string | string[];
1854
+ host_key_algorithms?: string | string[];
1855
+ client_version?: string;
1856
+ cipher?: string | string[];
1857
+ mac?: string | string[];
1858
+ kex_algorithm?: string | string[];
1859
+ } | {
1860
+ type: "tor";
1861
+ tag?: string;
1862
+ detour?: string;
1863
+ bind_interface?: string;
1864
+ inet4_bind_address?: string;
1865
+ inet6_bind_address?: string;
1866
+ bind_address_no_port?: boolean;
1867
+ protect_path?: string;
1868
+ routing_mark?: number | string;
1869
+ reuse_addr?: boolean;
1870
+ netns?: string;
1871
+ connect_timeout?: Duration;
1872
+ tcp_fast_open?: boolean;
1873
+ tcp_multi_path?: boolean;
1874
+ disable_tcp_keep_alive?: boolean;
1875
+ tcp_keep_alive?: Duration;
1876
+ tcp_keep_alive_interval?: Duration;
1877
+ udp_fragment?: boolean;
1878
+ domain_resolver?: DomainResolver$1;
1879
+ network_strategy?: "default" | "fallback" | "hybrid";
1880
+ network_type?: InterfaceType | InterfaceType[];
1881
+ fallback_network_type?: InterfaceType | InterfaceType[];
1882
+ fallback_delay?: Duration;
1883
+ executable_path?: string;
1884
+ extra_args?: string[];
1885
+ data_directory?: string;
1886
+ torrc?: {
1887
+ [k: string]: string;
1888
+ };
1889
+ } | {
1890
+ type: "trojan";
1891
+ tag?: string;
1892
+ detour?: string;
1893
+ bind_interface?: string;
1894
+ inet4_bind_address?: string;
1895
+ inet6_bind_address?: string;
1896
+ bind_address_no_port?: boolean;
1897
+ protect_path?: string;
1898
+ routing_mark?: number | string;
1899
+ reuse_addr?: boolean;
1900
+ netns?: string;
1901
+ connect_timeout?: Duration;
1902
+ tcp_fast_open?: boolean;
1903
+ tcp_multi_path?: boolean;
1904
+ disable_tcp_keep_alive?: boolean;
1905
+ tcp_keep_alive?: Duration;
1906
+ tcp_keep_alive_interval?: Duration;
1907
+ udp_fragment?: boolean;
1908
+ domain_resolver?: DomainResolver$1;
1909
+ network_strategy?: "default" | "fallback" | "hybrid";
1910
+ network_type?: InterfaceType | InterfaceType[];
1911
+ fallback_network_type?: InterfaceType | InterfaceType[];
1912
+ fallback_delay?: Duration;
1913
+ server?: string;
1914
+ server_port?: number;
1915
+ password?: string;
1916
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1917
+ tls?: OutboundTLSOptions;
1918
+ multiplex?: OutboundMultiplexOptions;
1919
+ transport?: V2RayTransport;
1920
+ } | {
1921
+ type: "tuic";
1922
+ tag?: string;
1923
+ detour?: string;
1924
+ bind_interface?: string;
1925
+ inet4_bind_address?: string;
1926
+ inet6_bind_address?: string;
1927
+ bind_address_no_port?: boolean;
1928
+ protect_path?: string;
1929
+ routing_mark?: number | string;
1930
+ reuse_addr?: boolean;
1931
+ netns?: string;
1932
+ connect_timeout?: Duration;
1933
+ tcp_fast_open?: boolean;
1934
+ tcp_multi_path?: boolean;
1935
+ disable_tcp_keep_alive?: boolean;
1936
+ tcp_keep_alive?: Duration;
1937
+ tcp_keep_alive_interval?: Duration;
1938
+ udp_fragment?: boolean;
1939
+ domain_resolver?: DomainResolver$1;
1940
+ network_strategy?: "default" | "fallback" | "hybrid";
1941
+ network_type?: InterfaceType | InterfaceType[];
1942
+ fallback_network_type?: InterfaceType | InterfaceType[];
1943
+ fallback_delay?: Duration;
1944
+ server?: string;
1945
+ server_port?: number;
1946
+ uuid?: string;
1947
+ password?: string;
1948
+ congestion_control?: "cubic" | "new_reno" | "bbr";
1949
+ udp_relay_mode?: "native" | "quic";
1950
+ udp_over_stream?: boolean;
1951
+ zero_rtt_handshake?: boolean;
1952
+ heartbeat?: Duration;
1953
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1954
+ tls?: OutboundTLSOptions;
1955
+ idle_timeout?: Duration;
1956
+ keep_alive_period?: Duration;
1957
+ stream_receive_window?: number | string;
1958
+ connection_receive_window?: number | string;
1959
+ max_concurrent_streams?: number;
1960
+ initial_packet_size?: number;
1961
+ disable_path_mtu_discovery?: boolean;
1962
+ } | {
1963
+ type: "urltest";
1964
+ tag?: string;
1965
+ outbounds?: string[];
1966
+ url?: string;
1967
+ interval?: Duration;
1968
+ tolerance?: number;
1969
+ idle_timeout?: Duration;
1970
+ interrupt_exist_connections?: boolean;
1971
+ } | {
1972
+ type: "vless";
1973
+ tag?: string;
1974
+ detour?: string;
1975
+ bind_interface?: string;
1976
+ inet4_bind_address?: string;
1977
+ inet6_bind_address?: string;
1978
+ bind_address_no_port?: boolean;
1979
+ protect_path?: string;
1980
+ routing_mark?: number | string;
1981
+ reuse_addr?: boolean;
1982
+ netns?: string;
1983
+ connect_timeout?: Duration;
1984
+ tcp_fast_open?: boolean;
1985
+ tcp_multi_path?: boolean;
1986
+ disable_tcp_keep_alive?: boolean;
1987
+ tcp_keep_alive?: Duration;
1988
+ tcp_keep_alive_interval?: Duration;
1989
+ udp_fragment?: boolean;
1990
+ domain_resolver?: DomainResolver$1;
1991
+ network_strategy?: "default" | "fallback" | "hybrid";
1992
+ network_type?: InterfaceType | InterfaceType[];
1993
+ fallback_network_type?: InterfaceType | InterfaceType[];
1994
+ fallback_delay?: Duration;
1995
+ server?: string;
1996
+ server_port?: number;
1997
+ uuid?: string;
1998
+ flow?: string;
1999
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
2000
+ tls?: OutboundTLSOptions;
2001
+ multiplex?: OutboundMultiplexOptions;
2002
+ transport?: V2RayTransport;
2003
+ packet_encoding?: string;
2004
+ } | {
2005
+ type: "vmess";
2006
+ tag?: string;
2007
+ detour?: string;
2008
+ bind_interface?: string;
2009
+ inet4_bind_address?: string;
2010
+ inet6_bind_address?: string;
2011
+ bind_address_no_port?: boolean;
2012
+ protect_path?: string;
2013
+ routing_mark?: number | string;
2014
+ reuse_addr?: boolean;
2015
+ netns?: string;
2016
+ connect_timeout?: Duration;
2017
+ tcp_fast_open?: boolean;
2018
+ tcp_multi_path?: boolean;
2019
+ disable_tcp_keep_alive?: boolean;
2020
+ tcp_keep_alive?: Duration;
2021
+ tcp_keep_alive_interval?: Duration;
2022
+ udp_fragment?: boolean;
2023
+ domain_resolver?: DomainResolver$1;
2024
+ network_strategy?: "default" | "fallback" | "hybrid";
2025
+ network_type?: InterfaceType | InterfaceType[];
2026
+ fallback_network_type?: InterfaceType | InterfaceType[];
2027
+ fallback_delay?: Duration;
2028
+ server?: string;
2029
+ server_port?: number;
2030
+ uuid?: string;
2031
+ security?: "auto" | "none" | "zero" | "aes-128-cfb" | "aes-128-gcm" | "chacha20-poly1305";
2032
+ alter_id?: number;
2033
+ global_padding?: boolean;
2034
+ authenticated_length?: boolean;
2035
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
2036
+ tls?: OutboundTLSOptions;
2037
+ packet_encoding?: "packetaddr" | "xudp";
2038
+ multiplex?: OutboundMultiplexOptions;
2039
+ transport?: V2RayTransport;
2040
+ };
2041
+ type Rule$1 = ({
2042
+ type?: "default" | "";
2043
+ inbound?: string | string[];
2044
+ ip_version?: 4 | 6;
2045
+ network?: ("tcp" | "udp" | "icmp") | ("tcp" | "udp" | "icmp")[];
2046
+ auth_user?: string | string[];
2047
+ protocol?: ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp") | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")[];
2048
+ client?: string | string[];
2049
+ domain?: string | string[];
2050
+ domain_suffix?: string | string[];
2051
+ domain_keyword?: string | string[];
2052
+ domain_regex?: string | string[];
2053
+ source_ip_cidr?: string | string[];
2054
+ source_ip_is_private?: boolean;
2055
+ ip_cidr?: string | string[];
2056
+ ip_is_private?: boolean;
2057
+ source_port?: number | number[];
2058
+ source_port_range?: string | string[];
2059
+ port?: number | number[];
2060
+ port_range?: string | string[];
2061
+ process_name?: string | string[];
2062
+ process_path?: string | string[];
2063
+ process_path_regex?: string | string[];
2064
+ package_name?: string | string[];
2065
+ package_name_regex?: string | string[];
2066
+ user?: string | string[];
2067
+ user_id?: number | number[];
2068
+ clash_mode?: string;
2069
+ network_type?: InterfaceType | InterfaceType[];
2070
+ network_is_expensive?: boolean;
2071
+ network_is_constrained?: boolean;
2072
+ wifi_ssid?: string | string[];
2073
+ wifi_bssid?: string | string[];
2074
+ interface_address?: {
2075
+ [k: string]: string | string[];
2076
+ };
2077
+ network_interface_address?: {
2078
+ [k: string]: string | string[];
2079
+ };
2080
+ default_interface_address?: string | string[];
2081
+ source_mac_address?: string | string[];
2082
+ source_hostname?: string | string[];
2083
+ preferred_by?: string | string[];
2084
+ rule_set?: string | string[];
2085
+ rule_set_ip_cidr_match_source?: boolean;
2086
+ invert?: boolean;
2087
+ } & RuleAction$1) | ({
2088
+ type: "logical";
2089
+ mode: "and" | "or";
2090
+ rules: NestedRule[];
2091
+ invert?: boolean;
2092
+ } & RuleAction$1);
2093
+ type RuleAction$1 = {
2094
+ action?: "route";
2095
+ outbound?: string;
2096
+ override_address?: string;
2097
+ override_port?: number;
2098
+ network_strategy?: "default" | "fallback" | "hybrid";
2099
+ fallback_delay?: number;
2100
+ udp_disable_domain_unmapping?: boolean;
2101
+ udp_connect?: boolean;
2102
+ udp_timeout?: Duration;
2103
+ tls_fragment?: boolean;
2104
+ tls_fragment_fallback_delay?: Duration;
2105
+ tls_record_fragment?: boolean;
2106
+ tls_spoof?: string;
2107
+ tls_spoof_method?: "wrong-sequence" | "wrong-checksum" | "wrong-ack" | "wrong-md5" | "wrong-timestamp";
2108
+ } | {
2109
+ action: "route-options";
2110
+ override_address?: string;
2111
+ override_port?: number;
2112
+ network_strategy?: "default" | "fallback" | "hybrid";
2113
+ fallback_delay?: number;
2114
+ udp_disable_domain_unmapping?: boolean;
2115
+ udp_connect?: boolean;
2116
+ udp_timeout?: Duration;
2117
+ tls_fragment?: boolean;
2118
+ tls_fragment_fallback_delay?: Duration;
2119
+ tls_record_fragment?: boolean;
2120
+ tls_spoof?: string;
2121
+ tls_spoof_method?: "wrong-sequence" | "wrong-checksum" | "wrong-ack" | "wrong-md5" | "wrong-timestamp";
2122
+ } | {
2123
+ action: "bypass";
2124
+ outbound?: string;
2125
+ override_address?: string;
2126
+ override_port?: number;
2127
+ network_strategy?: "default" | "fallback" | "hybrid";
2128
+ fallback_delay?: number;
2129
+ udp_disable_domain_unmapping?: boolean;
2130
+ udp_connect?: boolean;
2131
+ udp_timeout?: Duration;
2132
+ tls_fragment?: boolean;
2133
+ tls_fragment_fallback_delay?: Duration;
2134
+ tls_record_fragment?: boolean;
2135
+ tls_spoof?: string;
2136
+ tls_spoof_method?: "wrong-sequence" | "wrong-checksum" | "wrong-ack" | "wrong-md5" | "wrong-timestamp";
2137
+ } | {
2138
+ action: "reject";
2139
+ method?: "" | "default" | "drop" | "reply";
2140
+ no_drop?: boolean;
2141
+ } | {
2142
+ action: "hijack-dns";
2143
+ } | {
2144
+ action: "sniff";
2145
+ sniffer?: ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp") | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")[];
2146
+ timeout?: Duration;
2147
+ } | {
2148
+ action: "resolve";
2149
+ server?: string;
2150
+ timeout?: Duration;
2151
+ strategy?: DomainStrategy;
2152
+ disable_cache?: boolean;
2153
+ disable_optimistic_cache?: boolean;
2154
+ rewrite_ttl?: number;
2155
+ client_subnet?: string;
2156
+ };
2157
+ type NestedRule = {
2158
+ type?: "default" | "";
2159
+ inbound?: string | string[];
2160
+ ip_version?: 4 | 6;
2161
+ network?: ("tcp" | "udp" | "icmp") | ("tcp" | "udp" | "icmp")[];
2162
+ auth_user?: string | string[];
2163
+ protocol?: ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp") | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")[];
2164
+ client?: string | string[];
2165
+ domain?: string | string[];
2166
+ domain_suffix?: string | string[];
2167
+ domain_keyword?: string | string[];
2168
+ domain_regex?: string | string[];
2169
+ source_ip_cidr?: string | string[];
2170
+ source_ip_is_private?: boolean;
2171
+ ip_cidr?: string | string[];
2172
+ ip_is_private?: boolean;
2173
+ source_port?: number | number[];
2174
+ source_port_range?: string | string[];
2175
+ port?: number | number[];
2176
+ port_range?: string | string[];
2177
+ process_name?: string | string[];
2178
+ process_path?: string | string[];
2179
+ process_path_regex?: string | string[];
2180
+ package_name?: string | string[];
2181
+ package_name_regex?: string | string[];
2182
+ user?: string | string[];
2183
+ user_id?: number | number[];
2184
+ clash_mode?: string;
2185
+ network_type?: InterfaceType | InterfaceType[];
2186
+ network_is_expensive?: boolean;
2187
+ network_is_constrained?: boolean;
2188
+ wifi_ssid?: string | string[];
2189
+ wifi_bssid?: string | string[];
2190
+ interface_address?: {
2191
+ [k: string]: string | string[];
2192
+ };
2193
+ network_interface_address?: {
2194
+ [k: string]: string | string[];
2195
+ };
2196
+ default_interface_address?: string | string[];
2197
+ source_mac_address?: string | string[];
2198
+ source_hostname?: string | string[];
2199
+ preferred_by?: string | string[];
2200
+ rule_set?: string | string[];
2201
+ rule_set_ip_cidr_match_source?: boolean;
2202
+ invert?: boolean;
2203
+ } | {
2204
+ type: "logical";
2205
+ mode: "and" | "or";
2206
+ rules: NestedRule[];
2207
+ invert?: boolean;
2208
+ };
2209
+ type RuleSet = {
2210
+ type?: "inline" | "";
2211
+ tag: string | string[];
2212
+ rules?: HeadlessRule[];
2213
+ } | {
2214
+ type: "local";
2215
+ tag: string | string[];
2216
+ format?: "source" | "binary";
2217
+ path?: string;
2218
+ } | {
2219
+ type: "remote";
2220
+ tag: string | string[];
2221
+ format?: "source" | "binary";
2222
+ url?: string;
2223
+ initial_path?: string;
2224
+ http_client?: HTTPClientReference;
2225
+ update_interval?: Duration;
2226
+ };
2227
+ type HeadlessRule = {
2228
+ type?: "default" | "";
2229
+ query_type?: DNSQueryType | DNSQueryType[];
2230
+ network?: ("tcp" | "udp" | "icmp") | ("tcp" | "udp" | "icmp")[];
2231
+ domain?: string | string[];
2232
+ domain_suffix?: string | string[];
2233
+ domain_keyword?: string | string[];
2234
+ domain_regex?: string | string[];
2235
+ source_ip_cidr?: string | string[];
2236
+ ip_cidr?: string | string[];
2237
+ source_port?: number | number[];
2238
+ source_port_range?: string | string[];
2239
+ port?: number | number[];
2240
+ port_range?: string | string[];
2241
+ process_name?: string | string[];
2242
+ process_path?: string | string[];
2243
+ process_path_regex?: string | string[];
2244
+ package_name?: string | string[];
2245
+ package_name_regex?: string | string[];
2246
+ network_type?: InterfaceType | InterfaceType[];
2247
+ network_is_expensive?: boolean;
2248
+ network_is_constrained?: boolean;
2249
+ wifi_ssid?: string | string[];
2250
+ wifi_bssid?: string | string[];
2251
+ network_interface_address?: {
2252
+ [k: string]: string | string[];
2253
+ };
2254
+ default_interface_address?: string | string[];
2255
+ invert?: boolean;
2256
+ } | {
2257
+ type: "logical";
2258
+ mode: "and" | "or";
2259
+ rules: HeadlessRule[];
2260
+ invert?: boolean;
2261
+ };
2262
+ type Service = {
2263
+ type: "api";
2264
+ tag?: string;
2265
+ listen?: string;
2266
+ listen_port?: number;
2267
+ bind_interface?: string;
2268
+ routing_mark?: number | string;
2269
+ reuse_addr?: boolean;
2270
+ netns?: string;
2271
+ disable_tcp_keep_alive?: boolean;
2272
+ tcp_keep_alive?: Duration;
2273
+ tcp_keep_alive_interval?: Duration;
2274
+ tcp_fast_open?: boolean;
2275
+ tcp_multi_path?: boolean;
2276
+ udp_fragment?: boolean;
2277
+ udp_timeout?: UDPTimeout;
2278
+ detour?: string;
2279
+ secret?: string;
2280
+ access_control_allow_origin?: string | string[];
2281
+ access_control_allow_private_network?: boolean;
2282
+ dashboard?: boolean | string | {
2283
+ enabled?: boolean;
2284
+ path?: string;
2285
+ download_url?: string;
2286
+ http_client?: HTTPClientReference;
2287
+ update_interval?: Duration;
2288
+ };
2289
+ tls?: InboundTLSOptions;
2290
+ } | {
2291
+ type: "ccm";
2292
+ tag?: string;
2293
+ listen?: string;
2294
+ listen_port?: number;
2295
+ bind_interface?: string;
2296
+ routing_mark?: number | string;
2297
+ reuse_addr?: boolean;
2298
+ netns?: string;
2299
+ disable_tcp_keep_alive?: boolean;
2300
+ tcp_keep_alive?: Duration;
2301
+ tcp_keep_alive_interval?: Duration;
2302
+ tcp_fast_open?: boolean;
2303
+ tcp_multi_path?: boolean;
2304
+ udp_fragment?: boolean;
2305
+ udp_timeout?: UDPTimeout;
2306
+ detour?: string;
2307
+ tls?: InboundTLSOptions;
2308
+ credential_path?: string;
2309
+ users?: CCMUser[];
2310
+ headers?: HTTPHeader;
2311
+ usages_path?: string;
2312
+ } | {
2313
+ type: "derp";
2314
+ tag?: string;
2315
+ listen?: string;
2316
+ listen_port?: number;
2317
+ bind_interface?: string;
2318
+ routing_mark?: number | string;
2319
+ reuse_addr?: boolean;
2320
+ netns?: string;
2321
+ disable_tcp_keep_alive?: boolean;
2322
+ tcp_keep_alive?: Duration;
2323
+ tcp_keep_alive_interval?: Duration;
2324
+ tcp_fast_open?: boolean;
2325
+ tcp_multi_path?: boolean;
2326
+ udp_fragment?: boolean;
2327
+ udp_timeout?: UDPTimeout;
2328
+ detour?: string;
2329
+ tls?: InboundTLSOptions;
2330
+ config_path?: string;
2331
+ verify_client_endpoint?: string | string[];
2332
+ verify_client_url?: (string | {
2333
+ tag?: string;
2334
+ engine?: "go" | "apple";
2335
+ version?: 0 | 1 | 2 | 3;
2336
+ disable_version_fallback?: boolean;
2337
+ headers?: HTTPHeader;
2338
+ tls?: OutboundTLSOptions;
2339
+ detour?: string;
2340
+ bind_interface?: string;
2341
+ inet4_bind_address?: string;
2342
+ inet6_bind_address?: string;
2343
+ bind_address_no_port?: boolean;
2344
+ protect_path?: string;
2345
+ routing_mark?: number | string;
2346
+ reuse_addr?: boolean;
2347
+ netns?: string;
2348
+ connect_timeout?: Duration;
2349
+ tcp_fast_open?: boolean;
2350
+ tcp_multi_path?: boolean;
2351
+ disable_tcp_keep_alive?: boolean;
2352
+ tcp_keep_alive?: Duration;
2353
+ tcp_keep_alive_interval?: Duration;
2354
+ udp_fragment?: boolean;
2355
+ domain_resolver?: DomainResolver$1;
2356
+ network_strategy?: "default" | "fallback" | "hybrid";
2357
+ network_type?: InterfaceType | InterfaceType[];
2358
+ fallback_network_type?: InterfaceType | InterfaceType[];
2359
+ fallback_delay?: Duration;
2360
+ idle_timeout?: Duration;
2361
+ keep_alive_period?: Duration;
2362
+ stream_receive_window?: number | string;
2363
+ connection_receive_window?: number | string;
2364
+ max_concurrent_streams?: number;
2365
+ initial_packet_size?: number;
2366
+ disable_path_mtu_discovery?: boolean;
2367
+ url?: string;
2368
+ }) | (string | {
2369
+ tag?: string;
2370
+ engine?: "go" | "apple";
2371
+ version?: 0 | 1 | 2 | 3;
2372
+ disable_version_fallback?: boolean;
2373
+ headers?: HTTPHeader;
2374
+ tls?: OutboundTLSOptions;
2375
+ detour?: string;
2376
+ bind_interface?: string;
2377
+ inet4_bind_address?: string;
2378
+ inet6_bind_address?: string;
2379
+ bind_address_no_port?: boolean;
2380
+ protect_path?: string;
2381
+ routing_mark?: number | string;
2382
+ reuse_addr?: boolean;
2383
+ netns?: string;
2384
+ connect_timeout?: Duration;
2385
+ tcp_fast_open?: boolean;
2386
+ tcp_multi_path?: boolean;
2387
+ disable_tcp_keep_alive?: boolean;
2388
+ tcp_keep_alive?: Duration;
2389
+ tcp_keep_alive_interval?: Duration;
2390
+ udp_fragment?: boolean;
2391
+ domain_resolver?: DomainResolver$1;
2392
+ network_strategy?: "default" | "fallback" | "hybrid";
2393
+ network_type?: InterfaceType | InterfaceType[];
2394
+ fallback_network_type?: InterfaceType | InterfaceType[];
2395
+ fallback_delay?: Duration;
2396
+ idle_timeout?: Duration;
2397
+ keep_alive_period?: Duration;
2398
+ stream_receive_window?: number | string;
2399
+ connection_receive_window?: number | string;
2400
+ max_concurrent_streams?: number;
2401
+ initial_packet_size?: number;
2402
+ disable_path_mtu_discovery?: boolean;
2403
+ url?: string;
2404
+ })[];
2405
+ home?: string;
2406
+ mesh_with?: DERPMeshOptions | DERPMeshOptions[];
2407
+ mesh_psk?: string;
2408
+ mesh_psk_file?: string;
2409
+ stun?: number | {
2410
+ enabled?: boolean;
2411
+ listen?: string;
2412
+ listen_port?: number;
2413
+ bind_interface?: string;
2414
+ routing_mark?: number | string;
2415
+ reuse_addr?: boolean;
2416
+ netns?: string;
2417
+ disable_tcp_keep_alive?: boolean;
2418
+ tcp_keep_alive?: Duration;
2419
+ tcp_keep_alive_interval?: Duration;
2420
+ tcp_fast_open?: boolean;
2421
+ tcp_multi_path?: boolean;
2422
+ udp_fragment?: boolean;
2423
+ udp_timeout?: UDPTimeout;
2424
+ detour?: string;
2425
+ };
2426
+ } | {
2427
+ type: "hysteria-realm";
2428
+ tag?: string;
2429
+ listen?: string;
2430
+ listen_port?: number;
2431
+ bind_interface?: string;
2432
+ routing_mark?: number | string;
2433
+ reuse_addr?: boolean;
2434
+ netns?: string;
2435
+ disable_tcp_keep_alive?: boolean;
2436
+ tcp_keep_alive?: Duration;
2437
+ tcp_keep_alive_interval?: Duration;
2438
+ tcp_fast_open?: boolean;
2439
+ tcp_multi_path?: boolean;
2440
+ udp_fragment?: boolean;
2441
+ udp_timeout?: UDPTimeout;
2442
+ detour?: string;
2443
+ tls?: InboundTLSOptions;
2444
+ idle_timeout?: Duration;
2445
+ keep_alive_period?: Duration;
2446
+ stream_receive_window?: number | string;
2447
+ connection_receive_window?: number | string;
2448
+ max_concurrent_streams?: number;
2449
+ users?: HysteriaRealmUser[];
2450
+ } | {
2451
+ type: "ocm";
2452
+ tag?: string;
2453
+ listen?: string;
2454
+ listen_port?: number;
2455
+ bind_interface?: string;
2456
+ routing_mark?: number | string;
2457
+ reuse_addr?: boolean;
2458
+ netns?: string;
2459
+ disable_tcp_keep_alive?: boolean;
2460
+ tcp_keep_alive?: Duration;
2461
+ tcp_keep_alive_interval?: Duration;
2462
+ tcp_fast_open?: boolean;
2463
+ tcp_multi_path?: boolean;
2464
+ udp_fragment?: boolean;
2465
+ udp_timeout?: UDPTimeout;
2466
+ detour?: string;
2467
+ tls?: InboundTLSOptions;
2468
+ credential_path?: string;
2469
+ users?: OCMUser[];
2470
+ headers?: HTTPHeader;
2471
+ usages_path?: string;
2472
+ } | {
2473
+ type: "oom-killer";
2474
+ tag?: string;
2475
+ memory_limit?: number | string;
2476
+ safety_margin?: number | string;
2477
+ min_interval?: Duration;
2478
+ max_interval?: Duration;
2479
+ } | {
2480
+ type: "resolved";
2481
+ tag?: string;
2482
+ listen?: string;
2483
+ listen_port?: number;
2484
+ bind_interface?: string;
2485
+ routing_mark?: number | string;
2486
+ reuse_addr?: boolean;
2487
+ netns?: string;
2488
+ disable_tcp_keep_alive?: boolean;
2489
+ tcp_keep_alive?: Duration;
2490
+ tcp_keep_alive_interval?: Duration;
2491
+ tcp_fast_open?: boolean;
2492
+ tcp_multi_path?: boolean;
2493
+ udp_fragment?: boolean;
2494
+ udp_timeout?: UDPTimeout;
2495
+ detour?: string;
2496
+ } | {
2497
+ type: "ssm-api";
2498
+ tag?: string;
2499
+ listen?: string;
2500
+ listen_port?: number;
2501
+ bind_interface?: string;
2502
+ routing_mark?: number | string;
2503
+ reuse_addr?: boolean;
2504
+ netns?: string;
2505
+ disable_tcp_keep_alive?: boolean;
2506
+ tcp_keep_alive?: Duration;
2507
+ tcp_keep_alive_interval?: Duration;
2508
+ tcp_fast_open?: boolean;
2509
+ tcp_multi_path?: boolean;
2510
+ udp_fragment?: boolean;
2511
+ udp_timeout?: UDPTimeout;
2512
+ detour?: string;
2513
+ servers?: {
2514
+ [k: string]: string;
2515
+ };
2516
+ cache_path?: string;
2517
+ tls?: InboundTLSOptions;
2518
+ } | {
2519
+ type: "usbip-client";
2520
+ tag?: string;
2521
+ detour?: string;
2522
+ bind_interface?: string;
2523
+ inet4_bind_address?: string;
2524
+ inet6_bind_address?: string;
2525
+ bind_address_no_port?: boolean;
2526
+ protect_path?: string;
2527
+ routing_mark?: number | string;
2528
+ reuse_addr?: boolean;
2529
+ netns?: string;
2530
+ connect_timeout?: Duration;
2531
+ tcp_fast_open?: boolean;
2532
+ tcp_multi_path?: boolean;
2533
+ disable_tcp_keep_alive?: boolean;
2534
+ tcp_keep_alive?: Duration;
2535
+ tcp_keep_alive_interval?: Duration;
2536
+ udp_fragment?: boolean;
2537
+ domain_resolver?: DomainResolver$1;
2538
+ network_strategy?: "default" | "fallback" | "hybrid";
2539
+ network_type?: InterfaceType | InterfaceType[];
2540
+ fallback_network_type?: InterfaceType | InterfaceType[];
2541
+ fallback_delay?: Duration;
2542
+ server?: string;
2543
+ server_port?: number;
2544
+ devices?: USBIPDeviceMatch[];
2545
+ } | ({
2546
+ type: "usbip-server";
2547
+ tag?: string;
2548
+ provider?: "default" | "";
2549
+ listen?: string;
2550
+ listen_port?: number;
2551
+ bind_interface?: string;
2552
+ routing_mark?: number | string;
2553
+ reuse_addr?: boolean;
2554
+ netns?: string;
2555
+ disable_tcp_keep_alive?: boolean;
2556
+ tcp_keep_alive?: Duration;
2557
+ tcp_keep_alive_interval?: Duration;
2558
+ tcp_fast_open?: boolean;
2559
+ tcp_multi_path?: boolean;
2560
+ udp_fragment?: boolean;
2561
+ udp_timeout?: UDPTimeout;
2562
+ detour?: string;
2563
+ devices?: USBIPDeviceMatch[];
2564
+ } | {
2565
+ type: "usbip-server";
2566
+ tag?: string;
2567
+ provider: "dynamic";
2568
+ listen?: string;
2569
+ listen_port?: number;
2570
+ bind_interface?: string;
2571
+ routing_mark?: number | string;
2572
+ reuse_addr?: boolean;
2573
+ netns?: string;
2574
+ disable_tcp_keep_alive?: boolean;
2575
+ tcp_keep_alive?: Duration;
2576
+ tcp_keep_alive_interval?: Duration;
2577
+ tcp_fast_open?: boolean;
2578
+ tcp_multi_path?: boolean;
2579
+ udp_fragment?: boolean;
2580
+ udp_timeout?: UDPTimeout;
2581
+ detour?: string;
2582
+ });
2583
+ interface SingBoxConfig {
2584
+ $schema?: string;
2585
+ log?: LogOptions;
2586
+ dns?: DNS;
2587
+ ntp?: NTPOptions;
2588
+ certificate?: {
2589
+ store?: "system" | "mozilla" | "chrome" | "none";
2590
+ certificate?: string | string[];
2591
+ certificate_path?: string | string[];
2592
+ certificate_directory_path?: string | string[];
2593
+ };
2594
+ certificate_providers?: CertificateProvider$1[];
2595
+ http_clients?: HTTPClient[];
2596
+ network_namespaces?: NetworkNamespace[];
2597
+ endpoints?: Endpoint[];
2598
+ inbounds?: Inbound[];
2599
+ outbounds?: Outbound[];
2600
+ route?: RouteOptions;
2601
+ services?: Service[];
2602
+ experimental?: ExperimentalOptions;
2603
+ }
2604
+ interface LogOptions {
2605
+ disabled?: boolean;
2606
+ level?: "trace" | "debug" | "info" | "warn" | "warning" | "error" | "fatal" | "panic";
2607
+ output?: string;
2608
+ timestamp?: boolean;
2609
+ }
2610
+ interface DNS {
2611
+ servers?: DNSServer[];
2612
+ rules?: DNSRule[];
2613
+ final?: string;
2614
+ reverse_mapping?: boolean;
2615
+ strategy?: DomainStrategy;
2616
+ timeout?: Duration;
2617
+ disable_cache?: boolean;
2618
+ disable_expire?: boolean;
2619
+ cache_capacity?: number;
2620
+ optimistic?: boolean | {
2621
+ enabled?: boolean;
2622
+ timeout?: Duration;
2623
+ };
2624
+ client_subnet?: string;
2625
+ }
2626
+ interface OutboundTLSOptions {
2627
+ enabled?: boolean;
2628
+ engine?: "go" | "apple" | "windows";
2629
+ disable_sni?: boolean;
2630
+ server_name?: string;
2631
+ insecure?: boolean;
2632
+ alpn?: string | string[];
2633
+ min_version?: "1.0" | "1.1" | "1.2" | "1.3";
2634
+ max_version?: "1.0" | "1.1" | "1.2" | "1.3";
2635
+ cipher_suites?: string | string[];
2636
+ curve_preferences?: ("P256" | "P384" | "P521" | "X25519" | "X25519MLKEM768") | ("P256" | "P384" | "P521" | "X25519" | "X25519MLKEM768")[];
2637
+ certificate?: string | string[];
2638
+ certificate_path?: string;
2639
+ certificate_public_key_sha256?: (string | number[]) | (string | number[])[];
2640
+ client_certificate?: string | string[];
2641
+ client_certificate_path?: string;
2642
+ client_key?: string | string[];
2643
+ client_key_path?: string;
2644
+ fragment?: boolean;
2645
+ fragment_fallback_delay?: Duration;
2646
+ record_fragment?: boolean;
2647
+ spoof?: string;
2648
+ spoof_method?: "wrong-sequence" | "wrong-checksum" | "wrong-ack" | "wrong-md5" | "wrong-timestamp";
2649
+ kernel_tx?: boolean;
2650
+ kernel_rx?: boolean;
2651
+ handshake_timeout?: Duration;
2652
+ ech?: OutboundECHOptions;
2653
+ utls?: OutboundUTLSOptions;
2654
+ reality?: OutboundRealityOptions;
2655
+ }
2656
+ interface OutboundECHOptions {
2657
+ enabled?: boolean;
2658
+ config?: string | string[];
2659
+ config_path?: string;
2660
+ query_server_name?: string;
2661
+ }
2662
+ interface OutboundUTLSOptions {
2663
+ enabled?: boolean;
2664
+ fingerprint?: "chrome_psk" | "chrome_psk_shuffle" | "chrome_padding_psk_shuffle" | "chrome_pq" | "chrome_pq_psk" | "chrome" | "firefox" | "edge" | "safari" | "360" | "qq" | "ios" | "android" | "random" | "randomized";
2665
+ }
2666
+ interface OutboundRealityOptions {
2667
+ enabled?: boolean;
2668
+ public_key?: string;
2669
+ short_id?: string;
2670
+ }
2671
+ interface HTTPHeader {
2672
+ [k: string]: string | string[];
2673
+ }
2674
+ interface NTPOptions {
2675
+ enabled?: boolean;
2676
+ interval?: Duration;
2677
+ write_to_system?: boolean;
2678
+ server?: string;
2679
+ server_port?: number;
2680
+ detour?: string;
2681
+ bind_interface?: string;
2682
+ inet4_bind_address?: string;
2683
+ inet6_bind_address?: string;
2684
+ bind_address_no_port?: boolean;
2685
+ protect_path?: string;
2686
+ routing_mark?: number | string;
2687
+ reuse_addr?: boolean;
2688
+ netns?: string;
2689
+ connect_timeout?: Duration;
2690
+ tcp_fast_open?: boolean;
2691
+ tcp_multi_path?: boolean;
2692
+ disable_tcp_keep_alive?: boolean;
2693
+ tcp_keep_alive?: Duration;
2694
+ tcp_keep_alive_interval?: Duration;
2695
+ udp_fragment?: boolean;
2696
+ domain_resolver?: DomainResolver$1;
2697
+ network_strategy?: "default" | "fallback" | "hybrid";
2698
+ network_type?: InterfaceType | InterfaceType[];
2699
+ fallback_network_type?: InterfaceType | InterfaceType[];
2700
+ fallback_delay?: Duration;
2701
+ }
2702
+ interface ACMEExternalAccountOptions {
2703
+ key_id?: string;
2704
+ mac_key?: string;
2705
+ }
2706
+ interface HTTPClient {
2707
+ tag?: string;
2708
+ engine?: "go" | "apple";
2709
+ version?: 0 | 1 | 2 | 3;
2710
+ disable_version_fallback?: boolean;
2711
+ headers?: HTTPHeader;
2712
+ tls?: OutboundTLSOptions;
2713
+ detour?: string;
2714
+ bind_interface?: string;
2715
+ inet4_bind_address?: string;
2716
+ inet6_bind_address?: string;
2717
+ bind_address_no_port?: boolean;
2718
+ protect_path?: string;
2719
+ routing_mark?: number | string;
2720
+ reuse_addr?: boolean;
2721
+ netns?: string;
2722
+ connect_timeout?: Duration;
2723
+ tcp_fast_open?: boolean;
2724
+ tcp_multi_path?: boolean;
2725
+ disable_tcp_keep_alive?: boolean;
2726
+ tcp_keep_alive?: Duration;
2727
+ tcp_keep_alive_interval?: Duration;
2728
+ udp_fragment?: boolean;
2729
+ domain_resolver?: DomainResolver$1;
2730
+ network_strategy?: "default" | "fallback" | "hybrid";
2731
+ network_type?: InterfaceType | InterfaceType[];
2732
+ fallback_network_type?: InterfaceType | InterfaceType[];
2733
+ fallback_delay?: Duration;
2734
+ idle_timeout?: Duration;
2735
+ keep_alive_period?: Duration;
2736
+ stream_receive_window?: number | string;
2737
+ connection_receive_window?: number | string;
2738
+ max_concurrent_streams?: number;
2739
+ initial_packet_size?: number;
2740
+ disable_path_mtu_discovery?: boolean;
2741
+ }
2742
+ interface OpenConnectTokenOptions {
2743
+ mode?: "totp" | "hotp" | "stoken" | "oidc";
2744
+ secret?: string;
2745
+ secret_path?: string;
2746
+ pin?: string;
2747
+ password?: string;
2748
+ device_id?: string;
2749
+ counter?: number;
2750
+ }
2751
+ interface OpenConnectMobileOptions {
2752
+ platform_version?: string;
2753
+ device_type?: string;
2754
+ device_unique_id?: string;
2755
+ }
2756
+ interface OpenConnectCSDOptions {
2757
+ wrapper_path?: string;
2758
+ }
2759
+ interface OpenConnectHIPOptions {
2760
+ wrapper_path?: string;
2761
+ }
2762
+ interface OpenConnectTNCCOptions {
2763
+ wrapper_path?: string;
2764
+ device_id?: string;
2765
+ user_agent?: string;
2766
+ machine_identification_enabled?: boolean;
2767
+ certificates?: OpenConnectTNCCCertificateOptions[];
2768
+ }
2769
+ interface OpenConnectTNCCCertificateOptions {
2770
+ certificate?: string | string[];
2771
+ certificate_path?: string;
2772
+ }
2773
+ interface OpenConnectFortinetHostCheckOptions {
2774
+ hostcheck?: string;
2775
+ check_virtual_desktop?: string;
2776
+ }
2777
+ interface OpenConnectTLSOptions {
2778
+ insecure?: boolean;
2779
+ server_name?: string;
2780
+ peer_fingerprint?: string | string[];
2781
+ system_trust_disabled?: boolean;
2782
+ certificate_authority?: string | string[];
2783
+ certificate_authority_path?: string;
2784
+ client_certificate?: string | string[];
2785
+ client_certificate_path?: string;
2786
+ client_key?: string | string[];
2787
+ client_key_path?: string;
2788
+ client_key_password?: string;
2789
+ mca_certificate?: string | string[];
2790
+ mca_certificate_path?: string;
2791
+ mca_key?: string | string[];
2792
+ mca_key_path?: string;
2793
+ mca_key_password?: string;
2794
+ }
2795
+ interface OpenConnectFormEntryOptions {
2796
+ form_id?: string;
2797
+ submission_key?: string;
2798
+ name?: string;
2799
+ value?: string;
2800
+ promote?: boolean;
2801
+ }
2802
+ interface OpenVPNRemoteOptions {
2803
+ server?: string;
2804
+ server_port?: number;
2805
+ network?: "udp" | "udp4" | "udp6" | "tcp" | "tcp4" | "tcp6";
2806
+ }
2807
+ interface OpenVPNOutboundTLSOptions {
2808
+ server_name?: string;
2809
+ server_name_type?: "subject" | "name" | "name-prefix";
2810
+ certificate?: string | string[];
2811
+ certificate_path?: string;
2812
+ client_certificate?: string | string[];
2813
+ client_certificate_path?: string;
2814
+ client_key?: string | string[];
2815
+ client_key_path?: string;
2816
+ peer_fingerprint?: string | string[];
2817
+ crl_path?: string;
2818
+ remote_certificate_ku?: string | string[];
2819
+ remote_certificate_eku?: string;
2820
+ remote_certificate_tls?: "server" | "client" | "none";
2821
+ certificate_profile?: "legacy" | "preferred" | "insecure" | "suiteb";
2822
+ ns_certificate_type?: "server" | "client";
2823
+ version_min?: "1.0" | "1.1" | "1.2" | "1.3";
2824
+ version_max?: "1.0" | "1.1" | "1.2" | "1.3";
2825
+ cipher?: string;
2826
+ groups?: string;
2827
+ control_wrap?: OpenVPNControlWrapOptions;
2828
+ }
2829
+ interface OpenVPNControlWrapOptions {
2830
+ type?: "tls_auth" | "tls_crypt" | "tls_crypt_v2";
2831
+ key?: string | string[];
2832
+ key_path?: string;
2833
+ direction?: "server" | "client";
2834
+ }
2835
+ interface OpenVPNPullFilterOptions {
2836
+ action?: "accept" | "ignore" | "reject";
2837
+ text?: string;
2838
+ }
2839
+ interface User$1 {
2840
+ username?: string;
2841
+ password?: string;
2842
+ }
2843
+ interface OpenVPNInboundTLSOptions {
2844
+ certificate?: string | string[];
2845
+ certificate_path?: string;
2846
+ key?: string | string[];
2847
+ key_path?: string;
2848
+ client_certificate?: string | string[];
2849
+ client_certificate_path?: string;
2850
+ verify_client_certificate?: "require" | "optional" | "none";
2851
+ client_name?: string;
2852
+ client_name_type?: "subject" | "name" | "name-prefix";
2853
+ peer_fingerprint?: string | string[];
2854
+ crl_path?: string;
2855
+ remote_certificate_ku?: string | string[];
2856
+ remote_certificate_eku?: string;
2857
+ remote_certificate_tls?: "server" | "client" | "none";
2858
+ certificate_profile?: "legacy" | "preferred" | "insecure" | "suiteb";
2859
+ ns_certificate_type?: "server" | "client";
2860
+ version_min?: "1.0" | "1.1" | "1.2" | "1.3";
2861
+ version_max?: "1.0" | "1.1" | "1.2" | "1.3";
2862
+ cipher?: string;
2863
+ groups?: string;
2864
+ control_wrap?: OpenVPNInboundControlWrapOptions;
2865
+ }
2866
+ interface OpenVPNInboundControlWrapOptions {
2867
+ type?: "tls_auth" | "tls_crypt" | "tls_crypt_v2";
2868
+ key?: string | string[];
2869
+ key_path?: string;
2870
+ direction?: "server" | "client";
2871
+ force_cookie?: boolean;
2872
+ }
2873
+ interface OpenVPNPushOptions {
2874
+ routes?: string | string[];
2875
+ dns?: string | string[];
2876
+ dns_servers?: OpenVPNPushDNSServerOptions[];
2877
+ search_domains?: string | string[];
2878
+ dhcp_options?: string | string[];
2879
+ redirect_gateway?: boolean;
2880
+ redirect_gateway_flags?: string | string[];
2881
+ block_outside_dns?: boolean;
2882
+ ping_interval?: Duration;
2883
+ ping_restart?: Duration;
2884
+ }
2885
+ interface OpenVPNPushDNSServerOptions {
2886
+ priority?: number;
2887
+ addresses?: string | string[];
2888
+ resolve_domains?: string | string[];
2889
+ dnssec?: "yes" | "optional" | "no";
2890
+ transport?: "plain" | "dot" | "doh";
2891
+ sni?: string;
2892
+ }
2893
+ interface WireGuardPeer {
2894
+ address?: string;
2895
+ port?: number;
2896
+ public_key?: string;
2897
+ pre_shared_key?: string;
2898
+ allowed_ips?: string | string[];
2899
+ persistent_keepalive_interval?: number;
2900
+ reserved?: string | number[];
2901
+ }
2902
+ interface InboundTLSOptions {
2903
+ enabled?: boolean;
2904
+ server_name?: string;
2905
+ insecure?: boolean;
2906
+ alpn?: string | string[];
2907
+ min_version?: "1.0" | "1.1" | "1.2" | "1.3";
2908
+ max_version?: "1.0" | "1.1" | "1.2" | "1.3";
2909
+ cipher_suites?: string | string[];
2910
+ curve_preferences?: ("P256" | "P384" | "P521" | "X25519" | "X25519MLKEM768") | ("P256" | "P384" | "P521" | "X25519" | "X25519MLKEM768")[];
2911
+ certificate?: string | string[];
2912
+ certificate_path?: string;
2913
+ client_authentication?: "no" | "request" | "require-any" | "verify-if-given" | "require-and-verify";
2914
+ client_certificate?: string | string[];
2915
+ client_certificate_path?: string | string[];
2916
+ client_certificate_public_key_sha256?: (string | number[]) | (string | number[])[];
2917
+ key?: string | string[];
2918
+ key_path?: string;
2919
+ kernel_tx?: boolean;
2920
+ kernel_rx?: boolean;
2921
+ handshake_timeout?: Duration;
2922
+ certificate_provider?: CertificateProviderReference;
2923
+ ech?: InboundECHOptions;
2924
+ reality?: InboundRealityOptions;
2925
+ }
2926
+ interface InboundECHOptions {
2927
+ enabled?: boolean;
2928
+ key?: string | string[];
2929
+ key_path?: string;
2930
+ }
2931
+ interface InboundRealityOptions {
2932
+ enabled?: boolean;
2933
+ handshake?: InboundRealityHandshakeOptions;
2934
+ private_key?: string;
2935
+ short_id?: string | string[];
2936
+ max_time_difference?: Duration;
2937
+ }
2938
+ interface InboundRealityHandshakeOptions {
2939
+ server?: string;
2940
+ server_port?: number;
2941
+ detour?: string;
2942
+ bind_interface?: string;
2943
+ inet4_bind_address?: string;
2944
+ inet6_bind_address?: string;
2945
+ bind_address_no_port?: boolean;
2946
+ protect_path?: string;
2947
+ routing_mark?: number | string;
2948
+ reuse_addr?: boolean;
2949
+ netns?: string;
2950
+ connect_timeout?: Duration;
2951
+ tcp_fast_open?: boolean;
2952
+ tcp_multi_path?: boolean;
2953
+ disable_tcp_keep_alive?: boolean;
2954
+ tcp_keep_alive?: Duration;
2955
+ tcp_keep_alive_interval?: Duration;
2956
+ udp_fragment?: boolean;
2957
+ domain_resolver?: DomainResolver$1;
2958
+ network_strategy?: "default" | "fallback" | "hybrid";
2959
+ network_type?: InterfaceType | InterfaceType[];
2960
+ fallback_network_type?: InterfaceType | InterfaceType[];
2961
+ fallback_delay?: Duration;
2962
+ }
2963
+ interface AnyTLSUser {
2964
+ name?: string;
2965
+ password?: string;
2966
+ }
2967
+ interface DialerOptions {
2968
+ detour?: string;
2969
+ bind_interface?: string;
2970
+ inet4_bind_address?: string;
2971
+ inet6_bind_address?: string;
2972
+ bind_address_no_port?: boolean;
2973
+ protect_path?: string;
2974
+ routing_mark?: number | string;
2975
+ reuse_addr?: boolean;
2976
+ netns?: string;
2977
+ connect_timeout?: Duration;
2978
+ tcp_fast_open?: boolean;
2979
+ tcp_multi_path?: boolean;
2980
+ disable_tcp_keep_alive?: boolean;
2981
+ tcp_keep_alive?: Duration;
2982
+ tcp_keep_alive_interval?: Duration;
2983
+ udp_fragment?: boolean;
2984
+ domain_resolver?: DomainResolver$1;
2985
+ network_strategy?: "default" | "fallback" | "hybrid";
2986
+ network_type?: InterfaceType | InterfaceType[];
2987
+ fallback_network_type?: InterfaceType | InterfaceType[];
2988
+ fallback_delay?: Duration;
2989
+ }
2990
+ interface HysteriaUser {
2991
+ name?: string;
2992
+ auth?: string | number[];
2993
+ auth_str?: string;
2994
+ }
2995
+ interface Hysteria2User {
2996
+ name?: string;
2997
+ password?: string;
2998
+ }
2999
+ interface Hysteria2InboundRealm {
3000
+ server_url?: string;
3001
+ token?: string;
3002
+ realm_id?: string;
3003
+ stun_servers?: string | string[];
3004
+ ip_version?: 0 | 4 | 6;
3005
+ port_mapping?: Hysteria2RealmPortMapping;
3006
+ http_client?: HTTPClientReference;
3007
+ stun_domain_resolver?: DomainResolver$1;
3008
+ }
3009
+ interface Hysteria2RealmPortMapping {
3010
+ enabled?: boolean;
3011
+ timeout?: Duration;
3012
+ lifetime?: Duration;
3013
+ }
3014
+ interface ShadowsocksUser {
3015
+ name?: string;
3016
+ password?: string;
3017
+ }
3018
+ interface ShadowsocksDestination {
3019
+ name?: string;
3020
+ password?: string;
3021
+ server?: string;
3022
+ server_port?: number;
3023
+ }
3024
+ interface InboundMultiplexOptions {
3025
+ enabled?: boolean;
3026
+ padding?: boolean;
3027
+ brutal?: BrutalOptions;
3028
+ }
3029
+ interface BrutalOptions {
3030
+ enabled?: boolean;
3031
+ up_mbps?: number;
3032
+ down_mbps?: number;
3033
+ }
3034
+ interface ShadowTLSUser {
3035
+ name?: string;
3036
+ password?: string;
3037
+ }
3038
+ interface ShadowTLSHandshakeOptions {
3039
+ server?: string;
3040
+ server_port?: number;
3041
+ detour?: string;
3042
+ bind_interface?: string;
3043
+ inet4_bind_address?: string;
3044
+ inet6_bind_address?: string;
3045
+ bind_address_no_port?: boolean;
3046
+ protect_path?: string;
3047
+ routing_mark?: number | string;
3048
+ reuse_addr?: boolean;
3049
+ netns?: string;
3050
+ connect_timeout?: Duration;
3051
+ tcp_fast_open?: boolean;
3052
+ tcp_multi_path?: boolean;
3053
+ disable_tcp_keep_alive?: boolean;
3054
+ tcp_keep_alive?: Duration;
3055
+ tcp_keep_alive_interval?: Duration;
3056
+ udp_fragment?: boolean;
3057
+ domain_resolver?: DomainResolver$1;
3058
+ network_strategy?: "default" | "fallback" | "hybrid";
3059
+ network_type?: InterfaceType | InterfaceType[];
3060
+ fallback_network_type?: InterfaceType | InterfaceType[];
3061
+ fallback_delay?: Duration;
3062
+ }
3063
+ interface SnellUser {
3064
+ name?: string;
3065
+ userkey?: string;
3066
+ }
3067
+ interface TrojanUser {
3068
+ name?: string;
3069
+ password?: string;
3070
+ }
3071
+ interface ServerOptions {
3072
+ server?: string;
3073
+ server_port?: number;
3074
+ }
3075
+ interface TUICUser {
3076
+ name?: string;
3077
+ uuid?: string;
3078
+ password?: string;
3079
+ }
3080
+ interface TunPlatformOptions {
3081
+ http_proxy?: HTTPProxyOptions;
3082
+ }
3083
+ interface HTTPProxyOptions {
3084
+ enabled?: boolean;
3085
+ server?: string;
3086
+ server_port?: number;
3087
+ bypass_domain?: string | string[];
3088
+ match_domain?: string | string[];
3089
+ }
3090
+ interface VLESSUser {
3091
+ name?: string;
3092
+ uuid?: string;
3093
+ flow?: string;
3094
+ }
3095
+ interface VMessUser {
3096
+ name?: string;
3097
+ uuid?: string;
3098
+ alterId?: number;
3099
+ }
3100
+ interface Hysteria2Realm {
3101
+ server_url?: string;
3102
+ token?: string;
3103
+ realm_id?: string;
3104
+ stun_servers?: string | string[];
3105
+ ip_version?: 0 | 4 | 6;
3106
+ port_mapping?: Hysteria2RealmPortMapping;
3107
+ http_client?: HTTPClientReference;
3108
+ }
3109
+ interface OutboundMultiplexOptions {
3110
+ enabled?: boolean;
3111
+ protocol?: "h2mux" | "smux" | "yamux";
3112
+ max_connections?: number;
3113
+ min_streams?: number;
3114
+ max_streams?: number;
3115
+ padding?: boolean;
3116
+ brutal?: BrutalOptions;
3117
+ }
3118
+ interface RouteOptions {
3119
+ rules?: Rule$1[];
3120
+ rule_set?: RuleSet[];
3121
+ final?: string;
3122
+ find_process?: boolean;
3123
+ find_neighbor?: boolean;
3124
+ dhcp_lease_files?: string | string[];
3125
+ auto_detect_interface?: boolean;
3126
+ override_android_vpn?: boolean;
3127
+ default_interface?: string;
3128
+ default_mark?: number | string;
3129
+ default_domain_resolver?: DomainResolver$1;
3130
+ default_network_strategy?: "default" | "fallback" | "hybrid";
3131
+ default_network_type?: InterfaceType | InterfaceType[];
3132
+ default_fallback_network_type?: InterfaceType | InterfaceType[];
3133
+ default_fallback_delay?: Duration;
3134
+ default_http_client?: string;
3135
+ }
3136
+ interface CCMUser {
3137
+ name?: string;
3138
+ token?: string;
3139
+ }
3140
+ interface DERPMeshOptions {
3141
+ server?: string;
3142
+ server_port?: number;
3143
+ host?: string;
3144
+ tls?: OutboundTLSOptions;
3145
+ detour?: string;
3146
+ bind_interface?: string;
3147
+ inet4_bind_address?: string;
3148
+ inet6_bind_address?: string;
3149
+ bind_address_no_port?: boolean;
3150
+ protect_path?: string;
3151
+ routing_mark?: number | string;
3152
+ reuse_addr?: boolean;
3153
+ netns?: string;
3154
+ connect_timeout?: Duration;
3155
+ tcp_fast_open?: boolean;
3156
+ tcp_multi_path?: boolean;
3157
+ disable_tcp_keep_alive?: boolean;
3158
+ tcp_keep_alive?: Duration;
3159
+ tcp_keep_alive_interval?: Duration;
3160
+ udp_fragment?: boolean;
3161
+ domain_resolver?: DomainResolver$1;
3162
+ network_strategy?: "default" | "fallback" | "hybrid";
3163
+ network_type?: InterfaceType | InterfaceType[];
3164
+ fallback_network_type?: InterfaceType | InterfaceType[];
3165
+ fallback_delay?: Duration;
3166
+ }
3167
+ interface HysteriaRealmUser {
3168
+ name?: string;
3169
+ token?: string;
3170
+ max_realms?: number;
3171
+ }
3172
+ interface OCMUser {
3173
+ name?: string;
3174
+ token?: string;
3175
+ }
3176
+ interface USBIPDeviceMatch {
3177
+ bus_id?: string;
3178
+ vendor_id?: number;
3179
+ product_id?: number;
3180
+ serial?: string;
3181
+ }
3182
+ interface ExperimentalOptions {
3183
+ cache_file?: CacheFileOptions;
3184
+ clash_api?: ClashAPIOptions;
3185
+ v2ray_api?: V2RayAPIOptions;
3186
+ debug?: DebugOptions;
3187
+ }
3188
+ interface CacheFileOptions {
3189
+ enabled?: boolean;
3190
+ path?: string;
3191
+ cache_id?: string;
3192
+ store_fakeip?: boolean;
3193
+ rdrc_timeout?: Duration;
3194
+ store_dns?: boolean;
3195
+ }
3196
+ interface ClashAPIOptions {
3197
+ external_controller?: string;
3198
+ external_ui?: string;
3199
+ external_ui_download_url?: string;
3200
+ external_ui_download_detour?: string;
3201
+ secret?: string;
3202
+ default_mode?: string;
3203
+ access_control_allow_origin?: string | string[];
3204
+ access_control_allow_private_network?: boolean;
3205
+ }
3206
+ interface V2RayAPIOptions {
3207
+ listen?: string;
3208
+ stats?: V2RayStatsServiceOptions;
3209
+ }
3210
+ interface V2RayStatsServiceOptions {
3211
+ enabled?: boolean;
3212
+ inbounds?: string[];
3213
+ outbounds?: string[];
3214
+ users?: string[];
3215
+ }
3216
+ interface DebugOptions {
3217
+ listen?: string;
3218
+ gc_percent?: number;
3219
+ max_stack?: number;
3220
+ max_threads?: number;
3221
+ panic_on_fault?: boolean;
3222
+ trace_back?: string;
3223
+ memory_limit?: number | string;
3224
+ oom_killer?: boolean;
3225
+ }
3226
+ type Fields = Record<string, unknown>;
3227
+ type ReadonlyJson<T> = T extends object ? { readonly [K in keyof T]: ReadonlyJson<T[K]>; } : T;
3228
+ type Target = "inbounds" | "outbounds" | "endpoints" | "services" | "http_clients" | "dns.servers" | "route.rule_set" | "certificate_providers" | "network_namespaces";
3229
+ type Role = "inbound" | "listen-detour" | "dial-detour" | "egress" | "preferred-routes" | "dns-server" | "preferred-domain" | "ssm" | "certificate-provider" | "http-client" | "netns" | "rule-set" | "tailscale-endpoint";
3230
+ declare const resourceBrand: unique symbol;
3231
+ interface Resource<T extends Target = Target, K extends string = string, Tag extends string | readonly string[] | undefined = string | readonly string[] | undefined, R extends Role = Role> {
3232
+ readonly [resourceBrand]: {
3233
+ target: T;
3234
+ kind: K;
3235
+ tag: Tag;
3236
+ roles: R;
3237
+ };
3238
+ }
3239
+ type InboundRef = Resource<"inbounds" | "endpoints", string, string>;
3240
+ type ListenDetour = Resource<"inbounds", string, string, "listen-detour" | "inbound" | "ssm">;
3241
+ type Egress = Resource<"outbounds" | "endpoints", string, string>;
3242
+ type PreferredRoutes = Resource<"endpoints", "tailscale" | "wireguard", string>;
3243
+ type DnsServer = Resource<"dns.servers", string, string>;
3244
+ type PreferredDomain = Resource<"dns.servers", "tailscale", string>;
3245
+ type Namespace = Resource<"network_namespaces", string, string>;
3246
+ type CertificateProvider = Resource<"certificate_providers", string, string>;
3247
+ type TaggedHttpClient = Resource<"http_clients", "http-client", string>;
3248
+ type RuleSetRef = Resource<"route.rule_set", string, string | readonly [string]>;
3249
+ type SsmInbound = Resource<"inbounds", "shadowsocks", string, "inbound" | "listen-detour" | "ssm"> & {
3250
+ readonly [ssmBrand]: true;
3251
+ };
3252
+ declare const ssmBrand: unique symbol;
3253
+ type TailscaleEndpoint = Resource<"endpoints", "tailscale", string>;
3254
+ type Resolve = (value: unknown, role: Role, path: string) => string;
3255
+ type Expand = (value: unknown, path: string, resolve: Resolve) => unknown;
3256
+ type Expansions = Readonly<Record<string, Expand>>;
3257
+ type Scope = "route" | "dns";
3258
+ type OneOrMany<T> = T | readonly T[];
3259
+ type RouteLeaf = Exclude<NestedRule, {
3260
+ type: "logical";
3261
+ }>;
3262
+ type DnsLeaf = Exclude<NestedDNSRule, {
3263
+ type: "logical";
3264
+ }>;
3265
+ declare const commonMatches: readonly ["domain", "domain_suffix", "port", "auth_user"];
3266
+ declare const routeMatches: readonly ["client"];
3267
+ declare const dnsMatches: readonly ["query_type", "match_response", "response_rcode", "response_answer", "response_ns", "response_extra", "ip_cidr", "ip_is_private", "ip_accept_any"];
3268
+ type CommonMatches = ReadonlyJson<Pick<RouteLeaf, Exclude<(typeof commonMatches)[number], "auth_user">>> & {
3269
+ /** An empty string can match traffic with no authenticated name. */
3270
+ readonly auth_user?: OneOrMany<string>;
3271
+ readonly inbound?: OneOrMany<InboundRef>;
3272
+ readonly rule_set?: OneOrMany<RuleSetRef>;
3273
+ };
3274
+ type RouteMatches = ReadonlyJson<Pick<RouteLeaf, (typeof routeMatches)[number]>> & {
3275
+ readonly preferred_by?: OneOrMany<PreferredRoutes>;
3276
+ };
3277
+ type DnsMatches = ReadonlyJson<Pick<DnsLeaf, (typeof dnsMatches)[number]>> & {
3278
+ readonly preferred_by?: OneOrMany<PreferredDomain>;
3279
+ };
3280
+ type RouteMatchInput = CommonMatches & RouteMatches & { readonly [K in (typeof dnsMatches)[number]]?: never; };
3281
+ type DnsMatchInput = CommonMatches & DnsMatches & { readonly [K in (typeof routeMatches)[number]]?: never; };
3282
+ type MatchFields = RouteMatchInput | DnsMatchInput;
3283
+ type MatchScope<M> = ([M] extends [RouteMatchInput] ? "route" : never) | ([M] extends [DnsMatchInput] ? "dns" : never);
3284
+ declare const conditionBrand: unique symbol;
3285
+ interface Condition<S extends Scope = Scope> {
3286
+ readonly [conditionBrand]: S;
3287
+ and<O extends Scope>(other: Condition<O> & ([S & O] extends [never] ? never : unknown)): Condition<S & O>;
3288
+ or<O extends Scope>(other: Condition<O> & ([S & O] extends [never] ? never : unknown)): Condition<S & O>;
3289
+ not(): Condition<S>;
3290
+ }
3291
+ declare function match<M extends MatchFields>(input: M & Record<Exclude<keyof M, keyof MatchFields>, never>): Condition<MatchScope<M>>;
3292
+ export declare const Rule: Readonly<{
3293
+ match: typeof match;
3294
+ }>;
3295
+ type SharedDnsOptions = ReadonlyJson<Pick<Extract<DNSRuleAction, {
3296
+ action: "route-options";
3297
+ }>, "timeout" | "disable_cache" | "disable_optimistic_cache" | "rewrite_ttl" | "client_subnet" | "remove_client_subnet">>;
3298
+ type RejectOptions = Omit<Extract<RuleAction$1, {
3299
+ action: "reject";
3300
+ }>, "action" | "method"> & {
3301
+ method?: "default" | "drop";
3302
+ };
3303
+ type RouteRuleAction = {
3304
+ action: "route";
3305
+ outbound: Egress;
3306
+ } | {
3307
+ action: "bypass";
3308
+ outbound?: Egress;
3309
+ } | ({
3310
+ action: "reject";
3311
+ } & RejectOptions) | {
3312
+ action: "hijack-dns";
3313
+ };
3314
+ type DnsRuleAction = ({
3315
+ action: "route";
3316
+ server: DnsServer;
3317
+ speculative?: boolean;
3318
+ race?: boolean;
3319
+ } & SharedDnsOptions) | ({
3320
+ action: "evaluate";
3321
+ server: DnsServer;
3322
+ tag?: string;
3323
+ speculative?: boolean;
3324
+ } & SharedDnsOptions) | Extract<DNSRuleAction, {
3325
+ action: "respond";
3326
+ }> | ({
3327
+ action: "route-options";
3328
+ } & SharedDnsOptions) | ({
3329
+ action: "reject";
3330
+ race?: boolean;
3331
+ } & RejectOptions) | ReadonlyJson<Extract<DNSRuleAction, {
3332
+ action: "predefined";
3333
+ }>>;
3334
+ type RuleAction<S extends Scope> = {
3335
+ route: RouteRuleAction;
3336
+ dns: DnsRuleAction;
3337
+ }[S];
3338
+ declare const ruleBrand: unique symbol;
3339
+ interface RuleValue<S extends Scope> {
3340
+ readonly [ruleBrand]: S;
3341
+ }
3342
+ interface RuleFactory<S extends Scope> {
3343
+ (action: RuleAction<S>): RuleValue<S>;
3344
+ <C extends Scope>(condition: Condition<C> & (S extends C ? unknown : never), action: RuleAction<S>): RuleValue<S>;
3345
+ }
3346
+ export declare const route: Readonly<{
3347
+ rule: RuleFactory<"route">;
3348
+ }>;
3349
+ export declare const dns: Readonly<{
3350
+ rule: RuleFactory<"dns">;
3351
+ }>;
3352
+ type DomainResolver = DnsServer | (ReadonlyJson<Omit<Extract<DomainResolver$1, object>, "server">> & {
3353
+ readonly server: DnsServer;
3354
+ });
3355
+ interface DirectDial {
3356
+ /**
3357
+ * Go Duration string. An explicit detour disallows a non-zero timeout on
3358
+ * the resource using it. Configure the timeout on the detour target.
3359
+ * On a direct detour target, an effective zero is equivalent to omission.
3360
+ */
3361
+ readonly connect_timeout?: HTTPClient["connect_timeout"];
3362
+ readonly domain_resolver?: DomainResolver;
3363
+ readonly netns?: Namespace | string;
3364
+ }
3365
+ interface Dial extends DirectDial {
3366
+ readonly detour?: Egress;
3367
+ }
3368
+ interface Listener {
3369
+ readonly port: number;
3370
+ readonly netns?: Namespace | string;
3371
+ }
3372
+ interface InboundListener extends Listener {
3373
+ readonly detour?: ListenDetour;
3374
+ }
3375
+ type ServerTls = {
3376
+ side: "server";
3377
+ reality?: never;
3378
+ } & ((Required<Pick<InboundTLSOptions, "certificate_path" | "key_path">> & {
3379
+ certificate_provider?: never;
3380
+ }) | {
3381
+ certificate_provider: CertificateProvider;
3382
+ certificate_path?: never;
3383
+ key_path?: never;
3384
+ });
3385
+ type ClientTls = {
3386
+ side: "client";
3387
+ reality?: never;
3388
+ } & ReadonlyJson<Pick<OutboundTLSOptions, "server_name" | "certificate_path">>;
3389
+ type RealityServerTls = {
3390
+ side: "server";
3391
+ server_name: string;
3392
+ certificate_path?: never;
3393
+ key_path?: never;
3394
+ certificate_provider?: never;
3395
+ reality: {
3396
+ private_key: string;
3397
+ short_id: string | readonly string[];
3398
+ handshake: Required<Pick<InboundRealityHandshakeOptions, "server" | "server_port">> & Dial;
3399
+ };
3400
+ };
3401
+ type RealityClientTls = {
3402
+ side: "client";
3403
+ server_name: string;
3404
+ certificate_path?: never;
3405
+ reality: {
3406
+ public_key: string;
3407
+ short_id: string;
3408
+ };
3409
+ };
3410
+ type HttpClientValue = Resource<"http_clients", "http-client", string | undefined>;
3411
+ type InlineHttpClient = ReadonlyJson<Omit<Extract<HTTPClientReference, object>, keyof Dial>> & Dial & {
3412
+ readonly tag?: never;
3413
+ };
3414
+ type HttpClientInput = HttpClientValue | InlineHttpClient;
3415
+ type TlsMode = "server" | "client" | "server-reality" | "client-reality";
3416
+ interface CompileInput {
3417
+ readonly log?: ReadonlyJson<NonNullable<SingBoxConfig["log"]>>;
3418
+ readonly experimental?: ReadonlyJson<NonNullable<SingBoxConfig["experimental"]>>;
3419
+ readonly inbounds?: readonly Resource<"inbounds">[];
3420
+ readonly outbounds?: readonly Resource<"outbounds">[];
3421
+ readonly endpoints?: readonly Resource<"endpoints">[];
3422
+ readonly services?: readonly Resource<"services">[];
3423
+ readonly http_clients?: readonly TaggedHttpClient[];
3424
+ readonly certificate_providers?: readonly Resource<"certificate_providers">[];
3425
+ readonly network_namespaces?: readonly Resource<"network_namespaces">[];
3426
+ readonly route?: {
3427
+ readonly rules?: readonly RuleValue<"route">[];
3428
+ readonly rule_set?: readonly Resource<"route.rule_set">[];
3429
+ readonly final?: Egress;
3430
+ readonly default_domain_resolver?: DomainResolver;
3431
+ readonly default_http_client?: TaggedHttpClient;
3432
+ };
3433
+ readonly dns?: {
3434
+ readonly rules?: readonly RuleValue<"dns">[];
3435
+ readonly servers?: readonly DnsServer[];
3436
+ readonly final?: DnsServer;
3437
+ };
3438
+ }
3439
+ /**
3440
+ * Compile using registered final values. If you recreate a resource with the
3441
+ * same tag, rebuild its references so they refer to the new value.
3442
+ */
3443
+ export declare function compile(input: CompileInput): SingBoxConfig;
3444
+ declare const userBrand: unique symbol;
3445
+ interface User {
3446
+ readonly name: string;
3447
+ readonly [userBrand]: true;
3448
+ }
3449
+ export declare function user(input: {
3450
+ name: string;
3451
+ }): User;
3452
+ interface ListenMethod<T> {
3453
+ listen(address: string, options: T): this;
3454
+ }
3455
+ interface DialMethod<T> {
3456
+ dial(options: T): this;
3457
+ }
3458
+ interface TlsMethod<T> {
3459
+ tls(profile: T): this;
3460
+ }
3461
+ interface AuthMethod {
3462
+ authUser(user: User): Condition;
3463
+ }
3464
+ declare const targetRoles: {
3465
+ readonly inbounds: readonly ["inbound", "listen-detour"];
3466
+ readonly outbounds: readonly ["egress"];
3467
+ readonly endpoints: readonly ["egress", "inbound"];
3468
+ readonly services: readonly [];
3469
+ readonly http_clients: readonly ["http-client"];
3470
+ readonly "dns.servers": readonly ["dns-server"];
3471
+ readonly "route.rule_set": readonly ["rule-set"];
3472
+ readonly certificate_providers: readonly ["certificate-provider"];
3473
+ readonly network_namespaces: readonly ["netns"];
3474
+ };
3475
+ type PasswordEntry<Name extends "username" | "name"> = {
3476
+ readonly user: User;
3477
+ readonly password: string;
3478
+ } & { readonly [K in Name]?: never; };
3479
+ type MixedEntry = PasswordEntry<"username"> | (Readonly<User$1> & {
3480
+ user?: never;
3481
+ });
3482
+ type ShadowsocksEntry = PasswordEntry<"name"> | (Readonly<ShadowsocksUser> & {
3483
+ user?: never;
3484
+ });
3485
+ type VlessEntry = Required<Pick<VLESSUser, "uuid">> & Pick<VLESSUser, "flow"> & {
3486
+ user: User;
3487
+ name?: never;
3488
+ };
3489
+ interface AuthOptions {
3490
+ readonly name: "name" | "username";
3491
+ readonly credentials: readonly string[];
3492
+ readonly required: readonly string[];
3493
+ readonly allowRaw?: boolean;
3494
+ }
3495
+ interface Definition {
3496
+ readonly target: Target;
3497
+ readonly kind: string;
3498
+ readonly required: readonly string[];
3499
+ readonly optional?: readonly string[];
3500
+ readonly listen?: "listener" | "forwarding";
3501
+ readonly dial?: "direct" | "detour";
3502
+ readonly tls?: TlsMode;
3503
+ readonly auth?: AuthOptions;
3504
+ readonly roles?: readonly Role[];
3505
+ readonly references?: Expansions;
3506
+ readonly remoteDns?: boolean;
3507
+ readonly startupDetour?: boolean;
3508
+ readonly prepare?: (fields: Fields, path: string) => readonly Role[] | void;
3509
+ readonly checkDial?: (fields: Fields, dial: Fields, path: string) => void;
3510
+ }
3511
+ type RawByTarget = {
3512
+ inbounds: Inbound;
3513
+ outbounds: Outbound;
3514
+ endpoints: Endpoint;
3515
+ services: Service;
3516
+ http_clients: HTTPClient;
3517
+ "dns.servers": DNSServer;
3518
+ "route.rule_set": RuleSet;
3519
+ certificate_providers: CertificateProvider$1;
3520
+ network_namespaces: NetworkNamespace;
3521
+ };
3522
+ type Variant<Raw, Kind> = Raw extends {
3523
+ type?: infer Type;
3524
+ } ? Kind extends Type ? Raw : never : never;
3525
+ type Raw<D extends Definition> = D["target"] extends "http_clients" ? HTTPClient : Variant<RawByTarget[D["target"]], D["kind"]>;
3526
+ type Options<D extends Definition> = ReadonlyJson<Required<Pick<Raw<D>, Extract<D["required"][number], keyof Raw<D>>>> & Pick<Raw<D>, Extract<NonNullable<D["optional"]>[number], keyof Raw<D>>>>;
3527
+ type Override<T, U> = Omit<T, keyof U> & U;
3528
+ type TlsProfile = {
3529
+ server: ServerTls;
3530
+ client: ClientTls;
3531
+ "server-reality": ServerTls | RealityServerTls;
3532
+ "client-reality": ClientTls | RealityClientTls;
3533
+ };
3534
+ type Tag = string | readonly string[] | undefined;
3535
+ type ExtraRoles<D> = D extends {
3536
+ roles: readonly (infer R extends Role)[];
3537
+ } ? R : never;
3538
+ type Built<D extends Definition, T extends Tag = string> = Resource<D["target"], D["kind"], T, (typeof targetRoles)[D["target"]][number] | ExtraRoles<D>> & (D extends {
3539
+ listen: infer L;
3540
+ } ? ListenMethod<L extends "forwarding" ? InboundListener : Listener> : unknown) & (D extends {
3541
+ dial: infer F;
3542
+ } ? DialMethod<F extends "direct" ? DirectDial : Dial> : unknown) & (D extends {
3543
+ tls: infer P extends TlsMode;
3544
+ } ? TlsMethod<TlsProfile[P]> : unknown) & (D extends {
3545
+ auth: AuthOptions;
3546
+ } ? AuthMethod : unknown);
3547
+ declare const mixed: {
3548
+ readonly target: "inbounds";
3549
+ readonly kind: "mixed";
3550
+ readonly required: readonly ["tag"];
3551
+ readonly optional: readonly ["users", "set_system_proxy"];
3552
+ readonly listen: "forwarding";
3553
+ readonly tls: "server";
3554
+ readonly auth: {
3555
+ readonly name: "username";
3556
+ readonly credentials: readonly ["password"];
3557
+ readonly required: readonly ["password"];
3558
+ readonly allowRaw: true;
3559
+ };
3560
+ };
3561
+ declare const socks: {
3562
+ readonly target: "inbounds";
3563
+ readonly kind: "socks";
3564
+ readonly required: readonly ["tag"];
3565
+ readonly optional: readonly ["users"];
3566
+ readonly listen: "forwarding";
3567
+ readonly auth: {
3568
+ readonly name: "username";
3569
+ readonly credentials: readonly ["password"];
3570
+ readonly required: readonly ["password"];
3571
+ };
3572
+ };
3573
+ declare const inboundVless: {
3574
+ readonly target: "inbounds";
3575
+ readonly kind: "vless";
3576
+ readonly required: readonly ["tag", "users"];
3577
+ readonly listen: "forwarding";
3578
+ readonly tls: "server-reality";
3579
+ readonly auth: {
3580
+ readonly name: "name";
3581
+ readonly credentials: readonly ["uuid", "flow"];
3582
+ readonly required: readonly ["uuid"];
3583
+ };
3584
+ };
3585
+ declare const shadowsocks: {
3586
+ readonly target: "inbounds";
3587
+ readonly kind: "shadowsocks";
3588
+ readonly required: readonly ["tag", "method"];
3589
+ readonly optional: readonly ["network", "password", "users", "managed"];
3590
+ readonly listen: "forwarding";
3591
+ readonly auth: {
3592
+ readonly credentials: readonly ["password"];
3593
+ readonly required: readonly ["password"];
3594
+ readonly name: "name";
3595
+ readonly allowRaw: true;
3596
+ };
3597
+ readonly prepare: (fields: Fields, path: string) => "ssm"[] | undefined;
3598
+ };
3599
+ type ShadowsocksBase = Omit<Options<typeof shadowsocks>, "method" | "users" | "managed">;
3600
+ type Method = NonNullable<Extract<Inbound, {
3601
+ type: "shadowsocks";
3602
+ }>["method"]>;
3603
+ type MultiMethod = Exclude<Method, "none">;
3604
+ type ManagedShadowsocks = ShadowsocksBase & {
3605
+ method: MultiMethod;
3606
+ managed: true;
3607
+ users?: readonly [];
3608
+ };
3609
+ type StaticShadowsocks = ShadowsocksBase & {
3610
+ method: MultiMethod;
3611
+ managed?: false;
3612
+ users: readonly [ShadowsocksEntry, ...ShadowsocksEntry[]];
3613
+ };
3614
+ type ShadowsocksOptions = ShadowsocksBase & ({
3615
+ method: Method;
3616
+ managed?: false;
3617
+ users?: readonly [];
3618
+ } | {
3619
+ method: MultiMethod;
3620
+ managed?: boolean;
3621
+ users?: readonly [];
3622
+ } | {
3623
+ method: MultiMethod;
3624
+ managed?: false;
3625
+ users?: readonly ShadowsocksEntry[];
3626
+ });
3627
+ declare function makeShadowsocks(options: ManagedShadowsocks | StaticShadowsocks): Built<typeof shadowsocks> & SsmInbound;
3628
+ declare function makeShadowsocks(options: ShadowsocksOptions): Built<typeof shadowsocks>;
3629
+ export declare const inbound: Readonly<{
3630
+ mixed: (options: Override<Options<typeof mixed>, {
3631
+ users?: readonly MixedEntry[];
3632
+ }>) => Built<{
3633
+ readonly target: "inbounds";
3634
+ readonly kind: "mixed";
3635
+ readonly required: readonly ["tag"];
3636
+ readonly optional: readonly ["users", "set_system_proxy"];
3637
+ readonly listen: "forwarding";
3638
+ readonly tls: "server";
3639
+ readonly auth: {
3640
+ readonly name: "username";
3641
+ readonly credentials: readonly ["password"];
3642
+ readonly required: readonly ["password"];
3643
+ readonly allowRaw: true;
3644
+ };
3645
+ }, string>;
3646
+ socks: (options: Override<Options<typeof socks>, {
3647
+ users?: readonly PasswordEntry<"username">[];
3648
+ }>) => Built<{
3649
+ readonly target: "inbounds";
3650
+ readonly kind: "socks";
3651
+ readonly required: readonly ["tag"];
3652
+ readonly optional: readonly ["users"];
3653
+ readonly listen: "forwarding";
3654
+ readonly auth: {
3655
+ readonly name: "username";
3656
+ readonly credentials: readonly ["password"];
3657
+ readonly required: readonly ["password"];
3658
+ };
3659
+ }, string>;
3660
+ vless: (options: Override<Options<typeof inboundVless>, {
3661
+ users: readonly VlessEntry[];
3662
+ }>) => Built<{
3663
+ readonly target: "inbounds";
3664
+ readonly kind: "vless";
3665
+ readonly required: readonly ["tag", "users"];
3666
+ readonly listen: "forwarding";
3667
+ readonly tls: "server-reality";
3668
+ readonly auth: {
3669
+ readonly name: "name";
3670
+ readonly credentials: readonly ["uuid", "flow"];
3671
+ readonly required: readonly ["uuid"];
3672
+ };
3673
+ }, string>;
3674
+ shadowsocks: typeof makeShadowsocks;
3675
+ }>;
3676
+ declare const api: {
3677
+ readonly target: "services";
3678
+ readonly kind: "api";
3679
+ readonly required: readonly [];
3680
+ readonly optional: readonly ["tag", "secret", "dashboard", "access_control_allow_origin", "access_control_allow_private_network"];
3681
+ readonly listen: "listener";
3682
+ readonly tls: "server";
3683
+ readonly references: {
3684
+ readonly dashboard: Expand;
3685
+ };
3686
+ };
3687
+ type RawDashboard = NonNullable<Extract<Service, {
3688
+ type: "api";
3689
+ }>["dashboard"]>;
3690
+ type Dashboard = boolean | string | Override<ReadonlyJson<Extract<RawDashboard, object>>, {
3691
+ http_client?: HttpClientInput;
3692
+ }>;
3693
+ declare const ssmApi: {
3694
+ readonly target: "services";
3695
+ readonly kind: "ssm-api";
3696
+ readonly required: readonly ["servers"];
3697
+ readonly optional: readonly ["tag", "cache_path"];
3698
+ readonly listen: "listener";
3699
+ readonly tls: "server";
3700
+ readonly references: {
3701
+ readonly servers: Expand;
3702
+ };
3703
+ };
3704
+ export declare const service: Readonly<{
3705
+ /**
3706
+ * sing-box defaults to loopback (127.0.0.1). An omitted or empty secret allows
3707
+ * unauthenticated connections. Omitting server TLS uses plaintext TCP.
3708
+ */
3709
+ api: (options?: Override<Options<typeof api>, {
3710
+ dashboard?: Dashboard;
3711
+ }>) => Built<{
3712
+ readonly target: "services";
3713
+ readonly kind: "api";
3714
+ readonly required: readonly [];
3715
+ readonly optional: readonly ["tag", "secret", "dashboard", "access_control_allow_origin", "access_control_allow_private_network"];
3716
+ readonly listen: "listener";
3717
+ readonly tls: "server";
3718
+ readonly references: {
3719
+ readonly dashboard: Expand;
3720
+ };
3721
+ }, string | undefined>;
3722
+ ssmApi: (options: Override<Options<typeof ssmApi>, {
3723
+ servers: Readonly<Record<string, SsmInbound>>;
3724
+ }>) => Built<{
3725
+ readonly target: "services";
3726
+ readonly kind: "ssm-api";
3727
+ readonly required: readonly ["servers"];
3728
+ readonly optional: readonly ["tag", "cache_path"];
3729
+ readonly listen: "listener";
3730
+ readonly tls: "server";
3731
+ readonly references: {
3732
+ readonly servers: Expand;
3733
+ };
3734
+ }, string | undefined>;
3735
+ }>;
3736
+ declare const http: {
3737
+ readonly target: "http_clients";
3738
+ readonly kind: "http-client";
3739
+ readonly required: readonly [];
3740
+ readonly optional: readonly ["version", "headers", "tag"];
3741
+ readonly dial: "detour";
3742
+ readonly tls: "client";
3743
+ };
3744
+ export declare function httpClient(options: Options<typeof http> & {
3745
+ tag: string;
3746
+ }): Built<typeof http, string>;
3747
+ export declare function httpClient(options?: Options<typeof http>): Built<typeof http, string | undefined>;
3748
+ declare function checkGroup(fields: Fields, path: string): void;
3749
+ declare const selector: {
3750
+ readonly target: "outbounds";
3751
+ readonly kind: "selector";
3752
+ readonly required: readonly ["tag", "outbounds"];
3753
+ readonly optional: readonly ["default", "interrupt_exist_connections"];
3754
+ readonly prepare: typeof checkGroup;
3755
+ readonly references: {
3756
+ readonly outbounds: Expand;
3757
+ readonly default: Expand;
3758
+ };
3759
+ };
3760
+ declare const urltest: {
3761
+ readonly target: "outbounds";
3762
+ readonly kind: "urltest";
3763
+ readonly required: readonly ["tag", "outbounds"];
3764
+ readonly optional: readonly ["url", "interval", "tolerance", "idle_timeout", "interrupt_exist_connections"];
3765
+ readonly prepare: typeof checkGroup;
3766
+ readonly references: {
3767
+ readonly outbounds: Expand;
3768
+ };
3769
+ };
3770
+ export declare const outbound: Readonly<{
3771
+ direct: (options: {
3772
+ readonly tag: string;
3773
+ }) => Built<{
3774
+ readonly target: "outbounds";
3775
+ readonly kind: "direct";
3776
+ readonly required: readonly ["tag"];
3777
+ readonly dial: "direct";
3778
+ }, string>;
3779
+ vless: (options: {
3780
+ readonly tag: string;
3781
+ readonly server: string;
3782
+ readonly server_port: number;
3783
+ readonly uuid: string;
3784
+ readonly flow?: string;
3785
+ }) => Built<{
3786
+ readonly target: "outbounds";
3787
+ readonly kind: "vless";
3788
+ readonly required: readonly ["tag", "server", "server_port", "uuid"];
3789
+ readonly optional: readonly ["flow"];
3790
+ readonly dial: "detour";
3791
+ readonly tls: "client-reality";
3792
+ readonly startupDetour: true;
3793
+ }, string>;
3794
+ selector: (options: Override<Options<typeof selector>, {
3795
+ outbounds: readonly Egress[];
3796
+ default?: Egress;
3797
+ }>) => Resource<"outbounds", "selector", string, "egress">;
3798
+ urltest: (options: Override<Options<typeof urltest>, {
3799
+ outbounds: readonly Egress[];
3800
+ }>) => Resource<"outbounds", "urltest", string, "egress">;
3801
+ }>;
3802
+ export declare const endpoint: Readonly<{
3803
+ tailscale: (options: {
3804
+ readonly tag: string;
3805
+ readonly state_directory?: string;
3806
+ readonly auth_key?: string;
3807
+ readonly hostname?: string;
3808
+ readonly accept_routes?: boolean;
3809
+ readonly exit_node?: string;
3810
+ readonly listen_port?: number;
3811
+ }) => Built<{
3812
+ readonly target: "endpoints";
3813
+ readonly kind: "tailscale";
3814
+ readonly required: readonly ["tag"];
3815
+ readonly optional: readonly ["state_directory", "auth_key", "hostname", "accept_routes", "exit_node", "listen_port"];
3816
+ readonly dial: "detour";
3817
+ readonly roles: readonly ["preferred-routes", "tailscale-endpoint"];
3818
+ }, string>;
3819
+ wireguard: (options: {
3820
+ readonly tag: string;
3821
+ readonly system?: boolean;
3822
+ readonly address: string | readonly string[];
3823
+ readonly private_key: string;
3824
+ readonly listen_port?: number;
3825
+ readonly peers?: readonly {
3826
+ readonly address?: string;
3827
+ readonly port?: number;
3828
+ readonly public_key?: string;
3829
+ readonly pre_shared_key?: string;
3830
+ readonly allowed_ips?: string | readonly string[] | undefined;
3831
+ readonly persistent_keepalive_interval?: number;
3832
+ readonly reserved?: string | readonly number[] | undefined;
3833
+ }[] | undefined;
3834
+ }) => Built<{
3835
+ readonly target: "endpoints";
3836
+ readonly kind: "wireguard";
3837
+ readonly required: readonly ["tag", "address", "private_key"];
3838
+ readonly optional: readonly ["peers", "listen_port", "system"];
3839
+ readonly dial: "detour";
3840
+ readonly startupDetour: true;
3841
+ readonly roles: readonly ["preferred-routes"];
3842
+ readonly checkDial: (fields: Fields, dial: Fields, path: string) => void;
3843
+ }, string>;
3844
+ }>;
3845
+ declare const tailscaleDns: {
3846
+ readonly target: "dns.servers";
3847
+ readonly kind: "tailscale";
3848
+ readonly required: readonly ["tag", "endpoint"];
3849
+ readonly optional: readonly ["accept_default_resolvers", "accept_search_domain"];
3850
+ readonly roles: readonly ["preferred-domain"];
3851
+ readonly references: {
3852
+ readonly endpoint: Expand;
3853
+ };
3854
+ };
3855
+ export declare const dnsServer: Readonly<{
3856
+ tcp: (options: {
3857
+ readonly tag: string;
3858
+ readonly server: string;
3859
+ readonly server_port?: number;
3860
+ }) => Built<{
3861
+ readonly target: "dns.servers";
3862
+ readonly required: readonly ["tag", "server"];
3863
+ readonly optional: readonly ["server_port"];
3864
+ readonly dial: "detour";
3865
+ readonly remoteDns: true;
3866
+ readonly kind: "tcp";
3867
+ }, string>;
3868
+ udp: (options: {
3869
+ readonly tag: string;
3870
+ readonly server: string;
3871
+ readonly server_port?: number;
3872
+ }) => Built<{
3873
+ readonly target: "dns.servers";
3874
+ readonly required: readonly ["tag", "server"];
3875
+ readonly optional: readonly ["server_port"];
3876
+ readonly dial: "detour";
3877
+ readonly remoteDns: true;
3878
+ readonly kind: "udp";
3879
+ }, string>;
3880
+ tls: (options: {
3881
+ readonly tag: string;
3882
+ readonly server: string;
3883
+ readonly server_port?: number;
3884
+ }) => Built<{
3885
+ readonly target: "dns.servers";
3886
+ readonly required: readonly ["tag", "server"];
3887
+ readonly optional: readonly ["server_port"];
3888
+ readonly dial: "detour";
3889
+ readonly remoteDns: true;
3890
+ readonly kind: "tls";
3891
+ readonly tls: "client";
3892
+ }, string>;
3893
+ https: (options: {
3894
+ readonly tag: string;
3895
+ readonly server: string;
3896
+ readonly server_port?: number;
3897
+ readonly path?: string;
3898
+ readonly headers?: {
3899
+ readonly [x: string]: string | readonly string[];
3900
+ } | undefined;
3901
+ }) => Built<{
3902
+ readonly target: "dns.servers";
3903
+ readonly required: readonly ["tag", "server"];
3904
+ readonly dial: "detour";
3905
+ readonly remoteDns: true;
3906
+ readonly kind: "https";
3907
+ readonly tls: "client";
3908
+ readonly optional: readonly ["server_port", "path", "headers"];
3909
+ }, string>;
3910
+ tailscale: (options: Override<Options<typeof tailscaleDns>, {
3911
+ endpoint: TailscaleEndpoint;
3912
+ }>) => Resource<"dns.servers", "tailscale", string, "dns-server" | "preferred-domain">;
3913
+ }>;
3914
+ declare const tailscaleProvider: {
3915
+ readonly target: "certificate_providers";
3916
+ readonly kind: "tailscale";
3917
+ readonly required: readonly ["tag", "endpoint"];
3918
+ readonly references: {
3919
+ readonly endpoint: Expand;
3920
+ };
3921
+ };
3922
+ export declare const certificateProvider: Readonly<{
3923
+ tailscale: (options: Override<Options<typeof tailscaleProvider>, {
3924
+ endpoint: TailscaleEndpoint;
3925
+ }>) => Resource<"certificate_providers", "tailscale", string, "certificate-provider">;
3926
+ }>;
3927
+ export declare const networkNamespace: Readonly<{
3928
+ default: (options: {
3929
+ readonly tag: string;
3930
+ readonly path: string;
3931
+ }) => Resource<"network_namespaces", "default", string, "netns">;
3932
+ unshare: (options: {
3933
+ readonly tag: string;
3934
+ readonly pid_file?: string;
3935
+ }) => Resource<"network_namespaces", "unshare", string, "netns">;
3936
+ }>;
3937
+ declare const inlineRuleSet: {
3938
+ readonly target: "route.rule_set";
3939
+ readonly kind: "inline";
3940
+ readonly required: readonly ["tag", "rules"];
3941
+ readonly prepare: (fields: Fields, path: string) => void;
3942
+ };
3943
+ declare const localRuleSet: {
3944
+ readonly target: "route.rule_set";
3945
+ readonly kind: "local";
3946
+ readonly required: readonly ["tag", "path"];
3947
+ readonly optional: readonly ["format"];
3948
+ readonly prepare: (fields: Fields, path: string) => void;
3949
+ };
3950
+ declare const remoteRuleSet: {
3951
+ readonly target: "route.rule_set";
3952
+ readonly kind: "remote";
3953
+ readonly required: readonly ["tag", "url"];
3954
+ readonly optional: readonly ["format", "initial_path", "update_interval", "http_client"];
3955
+ readonly references: {
3956
+ readonly http_client: Expand;
3957
+ };
3958
+ readonly prepare: (fields: Fields, path: string) => void;
3959
+ };
3960
+ export declare const ruleSet: Readonly<{
3961
+ inline(options: {
3962
+ tag: string;
3963
+ rules: readonly ReadonlyJson<HeadlessRule>[];
3964
+ }): Built<typeof inlineRuleSet>;
3965
+ local<const T extends string | readonly string[]>(options: Override<Options<typeof localRuleSet>, {
3966
+ tag: T;
3967
+ }>): Resource<"route.rule_set", "local", T, "rule-set">;
3968
+ remote<const T extends string | readonly string[]>(options: Override<Options<typeof remoteRuleSet>, {
3969
+ tag: T;
3970
+ http_client?: HttpClientInput;
3971
+ }>): Resource<"route.rule_set", "remote", T, "rule-set">;
3972
+ }>;
3973
+ export declare function validateConfig(value: unknown): SingBoxConfig;
3974
+ export type { ClientTls, CompileInput, Condition, Dial, DirectDial, DnsRuleAction, DomainResolver, HeadlessRule, HttpClientInput, InboundListener, InlineHttpClient, Listener, MatchFields, RealityClientTls, RealityServerTls, RouteRuleAction, RuleAction, RuleValue, Scope, ServerTls, SingBoxConfig, User };