sing-box-kit 0.1.1 → 0.1.3

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,2671 @@
1
+ /* Generated by scripts/generate-schema.ts. */
2
+ import type {
3
+ CertificateProvider,
4
+ DnsServer,
5
+ Egress,
6
+ HttpClientValue,
7
+ InboundRef,
8
+ ListenDetour,
9
+ Namespace,
10
+ OpenConnectEndpoint,
11
+ OpenVpnClientEndpoint,
12
+ PreferredDomain,
13
+ PreferredRoutes,
14
+ ResolvedService,
15
+ RuleSetRef,
16
+ SsmInbound,
17
+ TaggedHttpClient,
18
+ TailscaleEndpoint
19
+ } from "../resource";
20
+
21
+ export type Duration = string;
22
+ export type UDPTimeout = number | string;
23
+ export type CertificateProviderReference =
24
+ | CertificateProvider
25
+ | (
26
+ | {
27
+ type: "acme";
28
+ domain?: string | string[];
29
+ data_directory?: string;
30
+ default_server_name?: string;
31
+ email?: string;
32
+ provider?: string;
33
+ account_key?: string;
34
+ disable_http_challenge?: boolean;
35
+ disable_tls_alpn_challenge?: boolean;
36
+ alternative_http_port?: number;
37
+ alternative_tls_port?: number;
38
+ external_account?: ACMEExternalAccountOptions;
39
+ dns01_challenge?: ACMEProviderDNS01Challenge;
40
+ key_type?: "ed25519" | "p256" | "p384" | "rsa2048" | "rsa4096";
41
+ profile?: string;
42
+ http_client?: HTTPClientReference;
43
+ }
44
+ | {
45
+ type: "cloudflare-origin-ca";
46
+ domain?: string | string[];
47
+ data_directory?: string;
48
+ api_token?: string;
49
+ origin_ca_key?: string;
50
+ request_type?: "origin-rsa" | "origin-ecc";
51
+ requested_validity?: 0 | 7 | 30 | 90 | 365 | 730 | 1095 | 5475;
52
+ http_client?: HTTPClientReference;
53
+ }
54
+ | {
55
+ type: "tailscale";
56
+ endpoint?: TailscaleEndpoint;
57
+ }
58
+ );
59
+ export type ACMEProviderDNS01Challenge =
60
+ | {
61
+ provider: "alidns";
62
+ ttl?: Duration;
63
+ propagation_delay?: Duration;
64
+ propagation_timeout?: Duration;
65
+ resolvers?: string | string[];
66
+ override_domain?: string;
67
+ access_key_id?: string;
68
+ access_key_secret?: string;
69
+ region_id?: string;
70
+ security_token?: string;
71
+ }
72
+ | {
73
+ provider: "cloudflare";
74
+ ttl?: Duration;
75
+ propagation_delay?: Duration;
76
+ propagation_timeout?: Duration;
77
+ resolvers?: string | string[];
78
+ override_domain?: string;
79
+ api_token?: string;
80
+ zone_token?: string;
81
+ }
82
+ | {
83
+ provider: "acmedns";
84
+ ttl?: Duration;
85
+ propagation_delay?: Duration;
86
+ propagation_timeout?: Duration;
87
+ resolvers?: string | string[];
88
+ override_domain?: string;
89
+ username?: string;
90
+ password?: string;
91
+ subdomain?: string;
92
+ server_url?: string;
93
+ };
94
+ export type HTTPClientReference =
95
+ | HttpClientValue
96
+ | {
97
+ engine?: "go" | "apple";
98
+ version?: 0 | 1 | 2 | 3;
99
+ disable_version_fallback?: boolean;
100
+ headers?: HTTPHeader;
101
+ tls?: OutboundTLSOptions;
102
+ detour?: Egress;
103
+ bind_interface?: string;
104
+ inet4_bind_address?: string;
105
+ inet6_bind_address?: string;
106
+ bind_address_no_port?: boolean;
107
+ protect_path?: string;
108
+ routing_mark?: number | string;
109
+ reuse_addr?: boolean;
110
+ netns?: Namespace | string;
111
+ connect_timeout?: Duration;
112
+ tcp_fast_open?: boolean;
113
+ tcp_multi_path?: boolean;
114
+ disable_tcp_keep_alive?: boolean;
115
+ tcp_keep_alive?: Duration;
116
+ tcp_keep_alive_interval?: Duration;
117
+ udp_fragment?: boolean;
118
+ domain_resolver?: DomainResolver;
119
+ network_strategy?: "default" | "fallback" | "hybrid";
120
+ network_type?: InterfaceType | InterfaceType[];
121
+ fallback_network_type?: InterfaceType | InterfaceType[];
122
+ fallback_delay?: Duration;
123
+ idle_timeout?: Duration;
124
+ keep_alive_period?: Duration;
125
+ stream_receive_window?: number | string;
126
+ connection_receive_window?: number | string;
127
+ max_concurrent_streams?: number;
128
+ initial_packet_size?: number;
129
+ disable_path_mtu_discovery?: boolean;
130
+ };
131
+ export type DomainResolver =
132
+ | DnsServer
133
+ | {
134
+ server: DnsServer;
135
+ timeout?: Duration;
136
+ strategy?: DomainStrategy;
137
+ disable_cache?: boolean;
138
+ disable_optimistic_cache?: boolean;
139
+ rewrite_ttl?: number;
140
+ client_subnet?: string;
141
+ };
142
+ export type DomainStrategy = "" | "as_is" | "prefer_ipv4" | "prefer_ipv6" | "ipv4_only" | "ipv6_only";
143
+ export type InterfaceType = "cellular" | "ethernet" | "other" | "wifi";
144
+ export type InboundSnellOptions =
145
+ | {
146
+ tag: string;
147
+ version: 5;
148
+ psk?: string;
149
+ users?: SnellUser[];
150
+ obfs_mode?: "none" | "http" | "tls";
151
+ }
152
+ | {
153
+ tag: string;
154
+ version: 6;
155
+ psk?: string;
156
+ users?: SnellUser[];
157
+ mode?: "default" | "unshaped" | "unsafe-raw";
158
+ };
159
+ export type V2RayTransport =
160
+ | {
161
+ type: "http";
162
+ host?: string | string[];
163
+ path?: string;
164
+ method?: string;
165
+ headers?: HTTPHeader;
166
+ idle_timeout?: Duration;
167
+ ping_timeout?: Duration;
168
+ }
169
+ | {
170
+ type: "ws";
171
+ path?: string;
172
+ headers?: HTTPHeader;
173
+ max_early_data?: number;
174
+ early_data_header_name?: string;
175
+ }
176
+ | {
177
+ type: "quic";
178
+ }
179
+ | {
180
+ type: "grpc";
181
+ service_name?: string;
182
+ idle_timeout?: Duration;
183
+ ping_timeout?: Duration;
184
+ permit_without_stream?: boolean;
185
+ }
186
+ | {
187
+ type: "httpupgrade";
188
+ host?: string;
189
+ path?: string;
190
+ headers?: HTTPHeader;
191
+ };
192
+ export type OutboundSnellOptions =
193
+ | {
194
+ tag: string;
195
+ version: 4;
196
+ server?: string;
197
+ server_port?: number;
198
+ psk?: string;
199
+ userkey?: string;
200
+ reuse?: boolean;
201
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
202
+ obfs_mode?: "none" | "http" | "tls";
203
+ obfs_host?: string;
204
+ }
205
+ | {
206
+ tag: string;
207
+ version: 6;
208
+ server?: string;
209
+ server_port?: number;
210
+ psk?: string;
211
+ userkey?: string;
212
+ reuse?: boolean;
213
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
214
+ mode?: "default" | "unshaped" | "unsafe-raw";
215
+ };
216
+ export type ServiceUsbipServerOptions =
217
+ | {
218
+ tag?: string;
219
+ provider?: "default" | "";
220
+ devices?: USBIPDeviceMatch[];
221
+ }
222
+ | {
223
+ tag?: string;
224
+ provider: "dynamic";
225
+ };
226
+ export type HeadlessRule =
227
+ | {
228
+ type?: "default" | "";
229
+ query_type?: DNSQueryType | DNSQueryType[];
230
+ network?: ("tcp" | "udp" | "icmp") | ("tcp" | "udp" | "icmp")[];
231
+ domain?: string | string[];
232
+ domain_suffix?: string | string[];
233
+ domain_keyword?: string | string[];
234
+ domain_regex?: string | string[];
235
+ source_ip_cidr?: string | string[];
236
+ ip_cidr?: string | string[];
237
+ source_port?: number | number[];
238
+ source_port_range?: string | string[];
239
+ port?: number | number[];
240
+ port_range?: string | string[];
241
+ process_name?: string | string[];
242
+ process_path?: string | string[];
243
+ process_path_regex?: string | string[];
244
+ package_name?: string | string[];
245
+ package_name_regex?: string | string[];
246
+ network_type?: InterfaceType | InterfaceType[];
247
+ network_is_expensive?: boolean;
248
+ network_is_constrained?: boolean;
249
+ wifi_ssid?: string | string[];
250
+ wifi_bssid?: string | string[];
251
+ network_interface_address?: {
252
+ cellular?: string | string[];
253
+ ethernet?: string | string[];
254
+ other?: string | string[];
255
+ wifi?: string | string[];
256
+ };
257
+ default_interface_address?: string | string[];
258
+ invert?: boolean;
259
+ }
260
+ | {
261
+ type: "logical";
262
+ mode: "and" | "or";
263
+ rules: HeadlessRule[];
264
+ invert?: boolean;
265
+ };
266
+ export type DNSQueryType =
267
+ | number
268
+ | (
269
+ | "A"
270
+ | "AAAA"
271
+ | "AFSDB"
272
+ | "AMTRELAY"
273
+ | "ANY"
274
+ | "APL"
275
+ | "ATMA"
276
+ | "AVC"
277
+ | "AXFR"
278
+ | "CAA"
279
+ | "CDNSKEY"
280
+ | "CDS"
281
+ | "CERT"
282
+ | "CNAME"
283
+ | "CSYNC"
284
+ | "DHCID"
285
+ | "DLV"
286
+ | "DNAME"
287
+ | "DNSKEY"
288
+ | "DS"
289
+ | "EID"
290
+ | "EUI48"
291
+ | "EUI64"
292
+ | "GID"
293
+ | "GPOS"
294
+ | "HINFO"
295
+ | "HIP"
296
+ | "HTTPS"
297
+ | "IPSECKEY"
298
+ | "ISDN"
299
+ | "IXFR"
300
+ | "KEY"
301
+ | "KX"
302
+ | "L32"
303
+ | "L64"
304
+ | "LOC"
305
+ | "LP"
306
+ | "MAILA"
307
+ | "MAILB"
308
+ | "MB"
309
+ | "MD"
310
+ | "MF"
311
+ | "MG"
312
+ | "MINFO"
313
+ | "MR"
314
+ | "MX"
315
+ | "NAPTR"
316
+ | "NID"
317
+ | "NIMLOC"
318
+ | "NINFO"
319
+ | "NS"
320
+ | "NSAP-PTR"
321
+ | "NSEC"
322
+ | "NSEC3"
323
+ | "NSEC3PARAM"
324
+ | "NULL"
325
+ | "NXNAME"
326
+ | "NXT"
327
+ | "None"
328
+ | "OPENPGPKEY"
329
+ | "OPT"
330
+ | "PTR"
331
+ | "PX"
332
+ | "RESINFO"
333
+ | "RKEY"
334
+ | "RP"
335
+ | "RRSIG"
336
+ | "RT"
337
+ | "Reserved"
338
+ | "SIG"
339
+ | "SMIMEA"
340
+ | "SOA"
341
+ | "SPF"
342
+ | "SRV"
343
+ | "SSHFP"
344
+ | "SVCB"
345
+ | "TA"
346
+ | "TALINK"
347
+ | "TKEY"
348
+ | "TLSA"
349
+ | "TSIG"
350
+ | "TXT"
351
+ | "UID"
352
+ | "UINFO"
353
+ | "UNSPEC"
354
+ | "URI"
355
+ | "X25"
356
+ | "ZONEMD"
357
+ );
358
+ export type DNSRCode =
359
+ | number
360
+ | (
361
+ | "NOERROR"
362
+ | "FORMERR"
363
+ | "SERVFAIL"
364
+ | "NXDOMAIN"
365
+ | "NOTIMP"
366
+ | "NOTIMPL"
367
+ | "REFUSED"
368
+ | "YXDOMAIN"
369
+ | "YXRRSET"
370
+ | "NXRRSET"
371
+ | "NOTAUTH"
372
+ | "NOTZONE"
373
+ | "DSOTYPENI"
374
+ | "BADSIG"
375
+ | "BADKEY"
376
+ | "BADTIME"
377
+ | "BADMODE"
378
+ | "BADNAME"
379
+ | "BADALG"
380
+ | "BADTRUNC"
381
+ | "BADCOOKIE"
382
+ );
383
+ export type RouteActionInput =
384
+ | {
385
+ action: "route";
386
+ outbound: Egress;
387
+ override_address?: string;
388
+ override_port?: number;
389
+ network_strategy?: "default" | "fallback" | "hybrid";
390
+ fallback_delay?: number;
391
+ udp_disable_domain_unmapping?: boolean;
392
+ udp_connect?: boolean;
393
+ udp_timeout?: Duration;
394
+ tls_fragment?: boolean;
395
+ tls_fragment_fallback_delay?: Duration;
396
+ tls_record_fragment?: boolean;
397
+ tls_spoof?: string;
398
+ tls_spoof_method?: "wrong-sequence" | "wrong-checksum" | "wrong-ack" | "wrong-md5" | "wrong-timestamp";
399
+ }
400
+ | {
401
+ action: "route-options";
402
+ override_address?: string;
403
+ override_port?: number;
404
+ network_strategy?: "default" | "fallback" | "hybrid";
405
+ fallback_delay?: number;
406
+ udp_disable_domain_unmapping?: boolean;
407
+ udp_connect?: boolean;
408
+ udp_timeout?: Duration;
409
+ tls_fragment?: boolean;
410
+ tls_fragment_fallback_delay?: Duration;
411
+ tls_record_fragment?: boolean;
412
+ tls_spoof?: string;
413
+ tls_spoof_method?: "wrong-sequence" | "wrong-checksum" | "wrong-ack" | "wrong-md5" | "wrong-timestamp";
414
+ }
415
+ | {
416
+ action: "bypass";
417
+ outbound?: Egress;
418
+ override_address?: string;
419
+ override_port?: number;
420
+ network_strategy?: "default" | "fallback" | "hybrid";
421
+ fallback_delay?: number;
422
+ udp_disable_domain_unmapping?: boolean;
423
+ udp_connect?: boolean;
424
+ udp_timeout?: Duration;
425
+ tls_fragment?: boolean;
426
+ tls_fragment_fallback_delay?: Duration;
427
+ tls_record_fragment?: boolean;
428
+ tls_spoof?: string;
429
+ tls_spoof_method?: "wrong-sequence" | "wrong-checksum" | "wrong-ack" | "wrong-md5" | "wrong-timestamp";
430
+ }
431
+ | {
432
+ action: "reject";
433
+ method?: "" | "default" | "drop" | "reply";
434
+ no_drop?: boolean;
435
+ }
436
+ | {
437
+ action: "hijack-dns";
438
+ }
439
+ | {
440
+ action: "sniff";
441
+ sniffer?:
442
+ | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")
443
+ | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")[];
444
+ timeout?: Duration;
445
+ }
446
+ | {
447
+ action: "resolve";
448
+ server?: DnsServer;
449
+ timeout?: Duration;
450
+ strategy?: DomainStrategy;
451
+ disable_cache?: boolean;
452
+ disable_optimistic_cache?: boolean;
453
+ rewrite_ttl?: number;
454
+ client_subnet?: string;
455
+ };
456
+ export type DnsActionInput =
457
+ | {
458
+ action: "route";
459
+ race?: boolean;
460
+ server: DnsServer;
461
+ speculative?: boolean;
462
+ timeout?: Duration;
463
+ disable_cache?: boolean;
464
+ disable_optimistic_cache?: boolean;
465
+ rewrite_ttl?: number;
466
+ client_subnet?: string;
467
+ remove_client_subnet?: boolean;
468
+ }
469
+ | {
470
+ action: "evaluate";
471
+ race?: boolean;
472
+ server: DnsServer;
473
+ tag?: string;
474
+ speculative?: boolean;
475
+ timeout?: Duration;
476
+ disable_cache?: boolean;
477
+ disable_optimistic_cache?: boolean;
478
+ rewrite_ttl?: number;
479
+ client_subnet?: string;
480
+ remove_client_subnet?: boolean;
481
+ }
482
+ | {
483
+ action: "respond";
484
+ race?: boolean;
485
+ }
486
+ | {
487
+ action: "route-options";
488
+ race?: boolean;
489
+ timeout?: Duration;
490
+ disable_cache?: boolean;
491
+ disable_optimistic_cache?: boolean;
492
+ rewrite_ttl?: number;
493
+ client_subnet?: string;
494
+ remove_client_subnet?: boolean;
495
+ }
496
+ | {
497
+ action: "reject";
498
+ race?: boolean;
499
+ method?: "default" | "drop";
500
+ no_drop?: boolean;
501
+ }
502
+ | {
503
+ action: "predefined";
504
+ race?: boolean;
505
+ rcode?: DNSRCode;
506
+ answer?: string | string[];
507
+ ns?: string | string[];
508
+ extra?: string | string[];
509
+ };
510
+
511
+ export interface SBKitInputs {
512
+ factories: {
513
+ inbounds: {
514
+ anytls: {
515
+ options: InboundAnytlsOptions;
516
+ listen: InboundAnytlsListen;
517
+ tls: InboundTLSOptions;
518
+ };
519
+ cloudflared: {
520
+ options: InboundCloudflaredOptions;
521
+ };
522
+ direct: {
523
+ options: InboundDirectOptions;
524
+ listen: InboundAnytlsListen;
525
+ };
526
+ http: {
527
+ options: InboundHttpOptions;
528
+ listen: InboundHttpListen;
529
+ tls: InboundTLSOptions;
530
+ };
531
+ hysteria: {
532
+ options: InboundHysteriaOptions;
533
+ listen: InboundAnytlsListen;
534
+ tls: InboundTLSOptions;
535
+ };
536
+ hysteria2: {
537
+ options: InboundHysteria2Options;
538
+ listen: InboundAnytlsListen;
539
+ tls: InboundTLSOptions;
540
+ };
541
+ mixed: {
542
+ options: InboundHttpOptions;
543
+ listen: InboundHttpListen;
544
+ tls: InboundTLSOptions;
545
+ };
546
+ naive: {
547
+ options: InboundNaiveOptions;
548
+ listen: InboundAnytlsListen;
549
+ tls: InboundTLSOptions;
550
+ };
551
+ redirect: {
552
+ options: InboundRedirectOptions;
553
+ listen: InboundAnytlsListen;
554
+ };
555
+ shadowsocks: {
556
+ options: InboundShadowsocksOptions;
557
+ listen: InboundAnytlsListen;
558
+ };
559
+ shadowtls: {
560
+ options: InboundShadowtlsOptions;
561
+ listen: InboundAnytlsListen;
562
+ };
563
+ snell: {
564
+ options: InboundSnellOptions;
565
+ listen: InboundAnytlsListen;
566
+ };
567
+ socks: {
568
+ options: InboundSocksOptions;
569
+ listen: InboundHttpListen;
570
+ };
571
+ tproxy: {
572
+ options: InboundTproxyOptions;
573
+ listen: InboundAnytlsListen;
574
+ };
575
+ trojan: {
576
+ options: InboundTrojanOptions;
577
+ listen: InboundAnytlsListen;
578
+ tls: InboundTLSOptions;
579
+ };
580
+ tuic: {
581
+ options: InboundTuicOptions;
582
+ listen: InboundAnytlsListen;
583
+ tls: InboundTLSOptions;
584
+ };
585
+ tun: {
586
+ options: InboundTunOptions;
587
+ listen: InboundTunListen;
588
+ };
589
+ vless: {
590
+ options: InboundVlessOptions;
591
+ listen: InboundAnytlsListen;
592
+ tls: InboundTLSOptions;
593
+ };
594
+ vmess: {
595
+ options: InboundVmessOptions;
596
+ listen: InboundAnytlsListen;
597
+ tls: InboundTLSOptions;
598
+ };
599
+ };
600
+ outbounds: {
601
+ anytls: {
602
+ options: OutboundAnytlsOptions;
603
+ dial: OutboundAnytlsDial;
604
+ tls: OutboundTLSOptions;
605
+ };
606
+ block: {
607
+ options: InboundRedirectOptions;
608
+ };
609
+ bridge: {
610
+ options: OutboundBridgeOptions;
611
+ };
612
+ direct: {
613
+ options: InboundRedirectOptions;
614
+ dial: OutboundDirectDial;
615
+ };
616
+ http: {
617
+ options: OutboundHttpOptions;
618
+ dial: OutboundAnytlsDial;
619
+ tls: OutboundTLSOptions;
620
+ };
621
+ hysteria: {
622
+ options: OutboundHysteriaOptions;
623
+ dial: OutboundAnytlsDial;
624
+ tls: OutboundTLSOptions;
625
+ };
626
+ hysteria2: {
627
+ options: OutboundHysteria2Options;
628
+ dial: OutboundAnytlsDial;
629
+ tls: OutboundTLSOptions;
630
+ };
631
+ naive: {
632
+ options: OutboundNaiveOptions;
633
+ dial: OutboundAnytlsDial;
634
+ tls: OutboundTLSOptions;
635
+ };
636
+ selector: {
637
+ options: OutboundSelectorOptions;
638
+ };
639
+ shadowsocks: {
640
+ options: OutboundShadowsocksOptions;
641
+ dial: OutboundAnytlsDial;
642
+ };
643
+ shadowtls: {
644
+ options: OutboundShadowtlsOptions;
645
+ dial: OutboundAnytlsDial;
646
+ tls: OutboundTLSOptions;
647
+ };
648
+ snell: {
649
+ options: OutboundSnellOptions;
650
+ dial: OutboundAnytlsDial;
651
+ };
652
+ socks: {
653
+ options: OutboundSocksOptions;
654
+ dial: OutboundAnytlsDial;
655
+ };
656
+ ssh: {
657
+ options: OutboundSshOptions;
658
+ dial: OutboundAnytlsDial;
659
+ };
660
+ tor: {
661
+ options: OutboundTorOptions;
662
+ dial: OutboundAnytlsDial;
663
+ };
664
+ trojan: {
665
+ options: OutboundTrojanOptions;
666
+ dial: OutboundAnytlsDial;
667
+ tls: OutboundTLSOptions;
668
+ };
669
+ tuic: {
670
+ options: OutboundTuicOptions;
671
+ dial: OutboundAnytlsDial;
672
+ tls: OutboundTLSOptions;
673
+ };
674
+ urltest: {
675
+ options: OutboundUrltestOptions;
676
+ };
677
+ vless: {
678
+ options: OutboundVlessOptions;
679
+ dial: OutboundAnytlsDial;
680
+ tls: OutboundTLSOptions;
681
+ };
682
+ vmess: {
683
+ options: OutboundVmessOptions;
684
+ dial: OutboundAnytlsDial;
685
+ tls: OutboundTLSOptions;
686
+ };
687
+ };
688
+ endpoints: {
689
+ openconnect: {
690
+ options: EndpointOpenconnectOptions;
691
+ dial: OutboundAnytlsDial;
692
+ tls: OpenConnectTLSOptions;
693
+ };
694
+ "openvpn-client": {
695
+ options: EndpointOpenvpnClientOptions;
696
+ dial: OutboundAnytlsDial;
697
+ tls: OpenVPNOutboundTLSOptions;
698
+ };
699
+ "openvpn-server": {
700
+ options: EndpointOpenvpnServerOptions;
701
+ listen: InboundAnytlsListen;
702
+ tls: OpenVPNInboundTLSOptions;
703
+ };
704
+ tailscale: {
705
+ options: EndpointTailscaleOptions;
706
+ dial: OutboundAnytlsDial;
707
+ };
708
+ wireguard: {
709
+ options: EndpointWireguardOptions;
710
+ dial: OutboundAnytlsDial;
711
+ };
712
+ };
713
+ services: {
714
+ api: {
715
+ options: ServiceApiOptions;
716
+ listen: InboundAnytlsListen;
717
+ tls: InboundTLSOptions;
718
+ };
719
+ ccm: {
720
+ options: ServiceCcmOptions;
721
+ listen: ServiceCcmListen;
722
+ tls: InboundTLSOptions;
723
+ };
724
+ derp: {
725
+ options: ServiceDerpOptions;
726
+ listen: InboundAnytlsListen;
727
+ tls: InboundTLSOptions;
728
+ };
729
+ "hysteria-realm": {
730
+ options: ServiceHysteriaRealmOptions;
731
+ listen: InboundAnytlsListen;
732
+ tls: InboundTLSOptions;
733
+ };
734
+ ocm: {
735
+ options: ServiceOcmOptions;
736
+ listen: ServiceCcmListen;
737
+ tls: InboundTLSOptions;
738
+ };
739
+ "oom-killer": {
740
+ options: ServiceOomKillerOptions;
741
+ };
742
+ resolved: {
743
+ options: ServiceResolvedOptions;
744
+ listen: InboundAnytlsListen;
745
+ };
746
+ "ssm-api": {
747
+ options: ServiceSsmApiOptions;
748
+ listen: InboundAnytlsListen;
749
+ tls: InboundTLSOptions;
750
+ };
751
+ "usbip-client": {
752
+ options: ServiceUsbipClientOptions;
753
+ dial: OutboundAnytlsDial;
754
+ };
755
+ "usbip-server": {
756
+ options: ServiceUsbipServerOptions;
757
+ listen: InboundAnytlsListen;
758
+ };
759
+ };
760
+ http_clients: {
761
+ "http-client": {
762
+ options: HTTPClientHttpClientOptions;
763
+ dial: OutboundAnytlsDial;
764
+ tls: OutboundTLSOptions;
765
+ };
766
+ };
767
+ "dns.servers": {
768
+ dhcp: {
769
+ options: DNSServerDhcpOptions;
770
+ dial: OutboundAnytlsDial;
771
+ };
772
+ fakeip: {
773
+ options: DNSServerFakeipOptions;
774
+ };
775
+ h3: {
776
+ options: DNSServerH3Options;
777
+ dial: OutboundAnytlsDial;
778
+ tls: OutboundTLSOptions;
779
+ };
780
+ hosts: {
781
+ options: DNSServerHostsOptions;
782
+ };
783
+ https: {
784
+ options: DNSServerHttpsOptions;
785
+ dial: OutboundAnytlsDial;
786
+ tls: OutboundTLSOptions;
787
+ };
788
+ local: {
789
+ options: DNSServerLocalOptions;
790
+ dial: OutboundAnytlsDial;
791
+ };
792
+ mdns: {
793
+ options: DNSServerMdnsOptions;
794
+ dial: OutboundAnytlsDial;
795
+ };
796
+ openconnect: {
797
+ options: DNSServerOpenconnectOptions;
798
+ };
799
+ openvpn: {
800
+ options: DNSServerOpenvpnOptions;
801
+ };
802
+ quic: {
803
+ options: DNSServerQuicOptions;
804
+ dial: OutboundAnytlsDial;
805
+ tls: OutboundTLSOptions;
806
+ };
807
+ resolved: {
808
+ options: DNSServerResolvedOptions;
809
+ };
810
+ tailscale: {
811
+ options: DNSServerTailscaleOptions;
812
+ };
813
+ tcp: {
814
+ options: DNSServerTcpOptions;
815
+ dial: OutboundAnytlsDial;
816
+ };
817
+ tls: {
818
+ options: DNSServerTcpOptions;
819
+ dial: OutboundAnytlsDial;
820
+ tls: OutboundTLSOptions;
821
+ };
822
+ udp: {
823
+ options: DNSServerTcpOptions;
824
+ dial: OutboundAnytlsDial;
825
+ };
826
+ };
827
+ "route.rule_set": {
828
+ inline: {
829
+ options: RuleSetInlineOptions;
830
+ };
831
+ local: {
832
+ options: RuleSetLocalOptions;
833
+ };
834
+ remote: {
835
+ options: RuleSetRemoteOptions;
836
+ };
837
+ };
838
+ certificate_providers: {
839
+ acme: {
840
+ options: CertificateProviderAcmeOptions;
841
+ };
842
+ "cloudflare-origin-ca": {
843
+ options: CertificateProviderCloudflareOriginCaOptions;
844
+ };
845
+ tailscale: {
846
+ options: CertificateProviderTailscaleOptions;
847
+ };
848
+ };
849
+ network_namespaces: {
850
+ default: {
851
+ options: NetworkNamespaceDefaultOptions;
852
+ };
853
+ unshare: {
854
+ options: NetworkNamespaceUnshareOptions;
855
+ };
856
+ };
857
+ };
858
+ root: {
859
+ $schema: string;
860
+ log: LogOptions;
861
+ ntp: NTPOptions;
862
+ certificate: {
863
+ store?: "system" | "mozilla" | "chrome" | "none";
864
+ certificate?: string | string[];
865
+ certificate_path?: string | string[];
866
+ certificate_directory_path?: string | string[];
867
+ };
868
+ experimental: ExperimentalOptions;
869
+ };
870
+ sections: {
871
+ route: RouteSettings;
872
+ dns: DnsSettings;
873
+ };
874
+ matches: {
875
+ route: RouteMatchFields;
876
+ dns: DnsMatchFields;
877
+ };
878
+ actions: {
879
+ route: RouteActionInput;
880
+ dns: DnsActionInput;
881
+ };
882
+ }
883
+ export interface InboundAnytlsOptions {
884
+ tag: string;
885
+ users?: AnyTLSUser[];
886
+ padding_scheme?: string | string[];
887
+ }
888
+ export interface AnyTLSUser {
889
+ name?: string;
890
+ password?: string;
891
+ }
892
+ export interface InboundAnytlsListen {
893
+ port?: number;
894
+ bind_interface?: string;
895
+ routing_mark?: number | string;
896
+ reuse_addr?: boolean;
897
+ netns?: Namespace | string;
898
+ disable_tcp_keep_alive?: boolean;
899
+ tcp_keep_alive?: Duration;
900
+ tcp_keep_alive_interval?: Duration;
901
+ tcp_fast_open?: boolean;
902
+ tcp_multi_path?: boolean;
903
+ udp_fragment?: boolean;
904
+ udp_timeout?: UDPTimeout;
905
+ detour?: ListenDetour;
906
+ }
907
+ export interface InboundTLSOptions {
908
+ enabled?: boolean;
909
+ server_name?: string;
910
+ insecure?: boolean;
911
+ alpn?: string | string[];
912
+ min_version?: "1.0" | "1.1" | "1.2" | "1.3";
913
+ max_version?: "1.0" | "1.1" | "1.2" | "1.3";
914
+ cipher_suites?: string | string[];
915
+ curve_preferences?:
916
+ | ("P256" | "P384" | "P521" | "X25519" | "X25519MLKEM768")
917
+ | ("P256" | "P384" | "P521" | "X25519" | "X25519MLKEM768")[];
918
+ certificate?: string | string[];
919
+ certificate_path?: string;
920
+ client_authentication?: "no" | "request" | "require-any" | "verify-if-given" | "require-and-verify";
921
+ client_certificate?: string | string[];
922
+ client_certificate_path?: string | string[];
923
+ client_certificate_public_key_sha256?: (string | number[]) | (string | number[])[];
924
+ key?: string | string[];
925
+ key_path?: string;
926
+ kernel_tx?: boolean;
927
+ kernel_rx?: boolean;
928
+ handshake_timeout?: Duration;
929
+ certificate_provider?: CertificateProviderReference;
930
+ ech?: InboundECHOptions;
931
+ reality?: InboundRealityOptions;
932
+ }
933
+ export interface ACMEExternalAccountOptions {
934
+ key_id?: string;
935
+ mac_key?: string;
936
+ }
937
+ export interface HTTPHeader {
938
+ [k: string]: string | string[];
939
+ }
940
+ export interface OutboundTLSOptions {
941
+ enabled?: boolean;
942
+ engine?: "go" | "apple" | "windows";
943
+ disable_sni?: boolean;
944
+ server_name?: string;
945
+ insecure?: boolean;
946
+ alpn?: string | string[];
947
+ min_version?: "1.0" | "1.1" | "1.2" | "1.3";
948
+ max_version?: "1.0" | "1.1" | "1.2" | "1.3";
949
+ cipher_suites?: string | string[];
950
+ curve_preferences?:
951
+ | ("P256" | "P384" | "P521" | "X25519" | "X25519MLKEM768")
952
+ | ("P256" | "P384" | "P521" | "X25519" | "X25519MLKEM768")[];
953
+ certificate?: string | string[];
954
+ certificate_path?: string;
955
+ certificate_public_key_sha256?: (string | number[]) | (string | number[])[];
956
+ client_certificate?: string | string[];
957
+ client_certificate_path?: string;
958
+ client_key?: string | string[];
959
+ client_key_path?: string;
960
+ fragment?: boolean;
961
+ fragment_fallback_delay?: Duration;
962
+ record_fragment?: boolean;
963
+ spoof?: string;
964
+ spoof_method?: "wrong-sequence" | "wrong-checksum" | "wrong-ack" | "wrong-md5" | "wrong-timestamp";
965
+ kernel_tx?: boolean;
966
+ kernel_rx?: boolean;
967
+ handshake_timeout?: Duration;
968
+ ech?: OutboundECHOptions;
969
+ utls?: OutboundUTLSOptions;
970
+ reality?: OutboundRealityOptions;
971
+ }
972
+ export interface OutboundECHOptions {
973
+ enabled?: boolean;
974
+ config?: string | string[];
975
+ config_path?: string;
976
+ query_server_name?: string;
977
+ }
978
+ export interface OutboundUTLSOptions {
979
+ enabled?: boolean;
980
+ fingerprint?:
981
+ | "chrome_psk"
982
+ | "chrome_psk_shuffle"
983
+ | "chrome_padding_psk_shuffle"
984
+ | "chrome_pq"
985
+ | "chrome_pq_psk"
986
+ | "chrome"
987
+ | "firefox"
988
+ | "edge"
989
+ | "safari"
990
+ | "360"
991
+ | "qq"
992
+ | "ios"
993
+ | "android"
994
+ | "random"
995
+ | "randomized";
996
+ }
997
+ export interface OutboundRealityOptions {
998
+ enabled?: boolean;
999
+ public_key?: string;
1000
+ short_id?: string;
1001
+ }
1002
+ export interface InboundECHOptions {
1003
+ enabled?: boolean;
1004
+ key?: string | string[];
1005
+ key_path?: string;
1006
+ }
1007
+ export interface InboundRealityOptions {
1008
+ enabled?: boolean;
1009
+ handshake?: InboundRealityHandshakeOptions;
1010
+ private_key?: string;
1011
+ short_id?: string | string[];
1012
+ max_time_difference?: Duration;
1013
+ }
1014
+ export interface InboundRealityHandshakeOptions {
1015
+ server?: string;
1016
+ server_port?: number;
1017
+ detour?: Egress;
1018
+ bind_interface?: string;
1019
+ inet4_bind_address?: string;
1020
+ inet6_bind_address?: string;
1021
+ bind_address_no_port?: boolean;
1022
+ protect_path?: string;
1023
+ routing_mark?: number | string;
1024
+ reuse_addr?: boolean;
1025
+ netns?: Namespace | string;
1026
+ connect_timeout?: Duration;
1027
+ tcp_fast_open?: boolean;
1028
+ tcp_multi_path?: boolean;
1029
+ disable_tcp_keep_alive?: boolean;
1030
+ tcp_keep_alive?: Duration;
1031
+ tcp_keep_alive_interval?: Duration;
1032
+ udp_fragment?: boolean;
1033
+ domain_resolver?: DomainResolver;
1034
+ network_strategy?: "default" | "fallback" | "hybrid";
1035
+ network_type?: InterfaceType | InterfaceType[];
1036
+ fallback_network_type?: InterfaceType | InterfaceType[];
1037
+ fallback_delay?: Duration;
1038
+ }
1039
+ export interface InboundCloudflaredOptions {
1040
+ tag: string;
1041
+ token?: string;
1042
+ ha_connections?: number;
1043
+ protocol?: "auto" | "quic" | "http2" | "h2mux";
1044
+ post_quantum?: boolean;
1045
+ edge_ip_version?: 0 | 4 | 6;
1046
+ datagram_version?: "v2" | "v3";
1047
+ grace_period?: Duration;
1048
+ region?: string;
1049
+ control_dialer?: DialerOptions;
1050
+ tunnel_dialer?: DialerOptions;
1051
+ }
1052
+ export interface DialerOptions {
1053
+ detour?: Egress;
1054
+ bind_interface?: string;
1055
+ inet4_bind_address?: string;
1056
+ inet6_bind_address?: string;
1057
+ bind_address_no_port?: boolean;
1058
+ protect_path?: string;
1059
+ routing_mark?: number | string;
1060
+ reuse_addr?: boolean;
1061
+ netns?: Namespace | string;
1062
+ connect_timeout?: Duration;
1063
+ tcp_fast_open?: boolean;
1064
+ tcp_multi_path?: boolean;
1065
+ disable_tcp_keep_alive?: boolean;
1066
+ tcp_keep_alive?: Duration;
1067
+ tcp_keep_alive_interval?: Duration;
1068
+ udp_fragment?: boolean;
1069
+ domain_resolver?: DomainResolver;
1070
+ network_strategy?: "default" | "fallback" | "hybrid";
1071
+ network_type?: InterfaceType | InterfaceType[];
1072
+ fallback_network_type?: InterfaceType | InterfaceType[];
1073
+ fallback_delay?: Duration;
1074
+ }
1075
+ export interface InboundDirectOptions {
1076
+ tag: string;
1077
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1078
+ override_address?: string;
1079
+ override_port?: number;
1080
+ }
1081
+ export interface InboundHttpOptions {
1082
+ tag: string;
1083
+ users?: User[];
1084
+ set_system_proxy?: boolean;
1085
+ }
1086
+ export interface User {
1087
+ username?: string;
1088
+ password?: string;
1089
+ }
1090
+ export interface InboundHttpListen {
1091
+ port?: number;
1092
+ bind_interface?: string;
1093
+ routing_mark?: number | string;
1094
+ reuse_addr?: boolean;
1095
+ netns?: Namespace | string;
1096
+ disable_tcp_keep_alive?: boolean;
1097
+ tcp_keep_alive?: Duration;
1098
+ tcp_keep_alive_interval?: Duration;
1099
+ tcp_fast_open?: boolean;
1100
+ tcp_multi_path?: boolean;
1101
+ udp_fragment?: boolean;
1102
+ udp_timeout?: UDPTimeout;
1103
+ detour?: ListenDetour;
1104
+ domain_resolver?: DomainResolver;
1105
+ }
1106
+ export interface InboundHysteriaOptions {
1107
+ tag: string;
1108
+ up?: number | string;
1109
+ up_mbps?: number;
1110
+ down?: number | string;
1111
+ down_mbps?: number;
1112
+ obfs?: string;
1113
+ users?: HysteriaUser[];
1114
+ idle_timeout?: Duration;
1115
+ keep_alive_period?: Duration;
1116
+ stream_receive_window?: number | string;
1117
+ connection_receive_window?: number | string;
1118
+ max_concurrent_streams?: number;
1119
+ initial_packet_size?: number;
1120
+ disable_path_mtu_discovery?: boolean;
1121
+ }
1122
+ export interface HysteriaUser {
1123
+ name?: string;
1124
+ auth?: string | number[];
1125
+ auth_str?: string;
1126
+ }
1127
+ export interface InboundHysteria2Options {
1128
+ tag: string;
1129
+ up_mbps?: number;
1130
+ down_mbps?: number;
1131
+ obfs?:
1132
+ | {
1133
+ type: "salamander";
1134
+ password?: string;
1135
+ }
1136
+ | {
1137
+ type: "gecko";
1138
+ password?: string;
1139
+ min_packet_size?: number;
1140
+ max_packet_size?: number;
1141
+ };
1142
+ users?: Hysteria2User[];
1143
+ ignore_client_bandwidth?: boolean;
1144
+ idle_timeout?: Duration;
1145
+ keep_alive_period?: Duration;
1146
+ stream_receive_window?: number | string;
1147
+ connection_receive_window?: number | string;
1148
+ max_concurrent_streams?: number;
1149
+ initial_packet_size?: number;
1150
+ disable_path_mtu_discovery?: boolean;
1151
+ masquerade?:
1152
+ | string
1153
+ | (
1154
+ | {
1155
+ type: "file";
1156
+ directory?: string;
1157
+ }
1158
+ | {
1159
+ type: "proxy";
1160
+ url?: string;
1161
+ rewrite_host?: boolean;
1162
+ }
1163
+ | {
1164
+ type: "string";
1165
+ status_code?: number;
1166
+ headers?: HTTPHeader;
1167
+ content?: string;
1168
+ }
1169
+ );
1170
+ bbr_profile?: "standard" | "conservative" | "aggressive";
1171
+ brutal_debug?: boolean;
1172
+ realm?: Hysteria2InboundRealm;
1173
+ }
1174
+ export interface Hysteria2User {
1175
+ name?: string;
1176
+ password?: string;
1177
+ }
1178
+ export interface Hysteria2InboundRealm {
1179
+ server_url?: string;
1180
+ token?: string;
1181
+ realm_id?: string;
1182
+ stun_servers?: string | string[];
1183
+ ip_version?: 0 | 4 | 6;
1184
+ port_mapping?: Hysteria2RealmPortMapping;
1185
+ http_client?: HTTPClientReference;
1186
+ stun_domain_resolver?: DomainResolver;
1187
+ }
1188
+ export interface Hysteria2RealmPortMapping {
1189
+ enabled?: boolean;
1190
+ timeout?: Duration;
1191
+ lifetime?: Duration;
1192
+ }
1193
+ export interface InboundNaiveOptions {
1194
+ tag: string;
1195
+ users?: User[];
1196
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1197
+ quic_congestion_control?: "bbr" | "cubic" | "reno";
1198
+ }
1199
+ export interface InboundRedirectOptions {
1200
+ tag: string;
1201
+ }
1202
+ export interface InboundShadowsocksOptions {
1203
+ tag: string;
1204
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1205
+ method:
1206
+ | "none"
1207
+ | "aes-128-gcm"
1208
+ | "aes-192-gcm"
1209
+ | "aes-256-gcm"
1210
+ | "chacha20-ietf-poly1305"
1211
+ | "xchacha20-ietf-poly1305"
1212
+ | "2022-blake3-aes-128-gcm"
1213
+ | "2022-blake3-aes-256-gcm"
1214
+ | "2022-blake3-chacha20-poly1305";
1215
+ password?: string;
1216
+ users?: ShadowsocksUser[];
1217
+ destinations?: ShadowsocksDestination[];
1218
+ multiplex?: InboundMultiplexOptions;
1219
+ managed?: boolean;
1220
+ }
1221
+ export interface ShadowsocksUser {
1222
+ name?: string;
1223
+ password?: string;
1224
+ }
1225
+ export interface ShadowsocksDestination {
1226
+ name?: string;
1227
+ password?: string;
1228
+ server?: string;
1229
+ server_port?: number;
1230
+ }
1231
+ export interface InboundMultiplexOptions {
1232
+ enabled?: boolean;
1233
+ padding?: boolean;
1234
+ brutal?: BrutalOptions;
1235
+ }
1236
+ export interface BrutalOptions {
1237
+ enabled?: boolean;
1238
+ up_mbps?: number;
1239
+ down_mbps?: number;
1240
+ }
1241
+ export interface InboundShadowtlsOptions {
1242
+ tag: string;
1243
+ version?: 1 | 2 | 3;
1244
+ password?: string;
1245
+ users?: ShadowTLSUser[];
1246
+ handshake?: ShadowTLSHandshakeOptions;
1247
+ handshake_for_server_name?: {
1248
+ [k: string]: ShadowTLSHandshakeOptions;
1249
+ };
1250
+ strict_mode?: boolean;
1251
+ wildcard_sni?: "" | "off" | "authed" | "all";
1252
+ }
1253
+ export interface ShadowTLSUser {
1254
+ name?: string;
1255
+ password?: string;
1256
+ }
1257
+ export interface ShadowTLSHandshakeOptions {
1258
+ server?: string;
1259
+ server_port?: number;
1260
+ detour?: Egress;
1261
+ bind_interface?: string;
1262
+ inet4_bind_address?: string;
1263
+ inet6_bind_address?: string;
1264
+ bind_address_no_port?: boolean;
1265
+ protect_path?: string;
1266
+ routing_mark?: number | string;
1267
+ reuse_addr?: boolean;
1268
+ netns?: Namespace | string;
1269
+ connect_timeout?: Duration;
1270
+ tcp_fast_open?: boolean;
1271
+ tcp_multi_path?: boolean;
1272
+ disable_tcp_keep_alive?: boolean;
1273
+ tcp_keep_alive?: Duration;
1274
+ tcp_keep_alive_interval?: Duration;
1275
+ udp_fragment?: boolean;
1276
+ domain_resolver?: DomainResolver;
1277
+ network_strategy?: "default" | "fallback" | "hybrid";
1278
+ network_type?: InterfaceType | InterfaceType[];
1279
+ fallback_network_type?: InterfaceType | InterfaceType[];
1280
+ fallback_delay?: Duration;
1281
+ }
1282
+ export interface SnellUser {
1283
+ name?: string;
1284
+ userkey?: string;
1285
+ }
1286
+ export interface InboundSocksOptions {
1287
+ tag: string;
1288
+ users?: User[];
1289
+ }
1290
+ export interface InboundTproxyOptions {
1291
+ tag: string;
1292
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1293
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1294
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1295
+ udp_nat_max?: number;
1296
+ }
1297
+ export interface InboundTrojanOptions {
1298
+ tag: string;
1299
+ users?: TrojanUser[];
1300
+ fallback?: ServerOptions;
1301
+ fallback_for_alpn?: {
1302
+ [k: string]: ServerOptions;
1303
+ };
1304
+ multiplex?: InboundMultiplexOptions;
1305
+ transport?: V2RayTransport;
1306
+ }
1307
+ export interface TrojanUser {
1308
+ name?: string;
1309
+ password?: string;
1310
+ }
1311
+ export interface ServerOptions {
1312
+ server?: string;
1313
+ server_port?: number;
1314
+ }
1315
+ export interface InboundTuicOptions {
1316
+ tag: string;
1317
+ users?: TUICUser[];
1318
+ congestion_control?: "cubic" | "new_reno" | "bbr";
1319
+ auth_timeout?: Duration;
1320
+ zero_rtt_handshake?: boolean;
1321
+ heartbeat?: Duration;
1322
+ idle_timeout?: Duration;
1323
+ keep_alive_period?: Duration;
1324
+ stream_receive_window?: number | string;
1325
+ connection_receive_window?: number | string;
1326
+ max_concurrent_streams?: number;
1327
+ initial_packet_size?: number;
1328
+ disable_path_mtu_discovery?: boolean;
1329
+ }
1330
+ export interface TUICUser {
1331
+ name?: string;
1332
+ uuid?: string;
1333
+ password?: string;
1334
+ }
1335
+ export interface InboundTunOptions {
1336
+ tag: string;
1337
+ interface_name?: string;
1338
+ mtu?: number;
1339
+ address?: string | string[];
1340
+ dns_mode?: "disabled" | "native" | "hijack";
1341
+ dns_address?: string | string[];
1342
+ auto_route?: boolean;
1343
+ iproute2_table_index?: number;
1344
+ iproute2_rule_index?: number;
1345
+ auto_redirect?: boolean;
1346
+ auto_redirect_input_mark?: number | string;
1347
+ auto_redirect_output_mark?: number | string;
1348
+ auto_redirect_reset_mark?: number | string;
1349
+ auto_redirect_nfqueue?: number;
1350
+ auto_redirect_iproute2_fallback_rule_index?: number;
1351
+ exclude_mptcp?: boolean;
1352
+ loopback_address?: string | string[];
1353
+ strict_route?: boolean;
1354
+ route_address?: string | string[];
1355
+ route_address_set?: string | string[];
1356
+ route_exclude_address?: string | string[];
1357
+ route_exclude_address_set?: string | string[];
1358
+ include_interface?: string | string[];
1359
+ exclude_interface?: string | string[];
1360
+ include_uid?: number | number[];
1361
+ include_uid_range?: string | string[];
1362
+ exclude_uid?: number | number[];
1363
+ exclude_uid_range?: string | string[];
1364
+ include_android_user?: number | number[];
1365
+ include_package?: string | string[];
1366
+ exclude_package?: string | string[];
1367
+ include_mac_address?: string | string[];
1368
+ exclude_mac_address?: string | string[];
1369
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1370
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1371
+ udp_nat_max?: number;
1372
+ stack?: "system" | "gvisor" | "mixed";
1373
+ platform?: TunPlatformOptions;
1374
+ }
1375
+ export interface TunPlatformOptions {
1376
+ http_proxy?: HTTPProxyOptions;
1377
+ }
1378
+ export interface HTTPProxyOptions {
1379
+ enabled?: boolean;
1380
+ server?: string;
1381
+ server_port?: number;
1382
+ bypass_domain?: string | string[];
1383
+ match_domain?: string | string[];
1384
+ }
1385
+ export interface InboundTunListen {
1386
+ netns?: Namespace | string;
1387
+ udp_timeout?: UDPTimeout;
1388
+ }
1389
+ export interface InboundVlessOptions {
1390
+ tag: string;
1391
+ users: VLESSUser[];
1392
+ multiplex?: InboundMultiplexOptions;
1393
+ transport?: V2RayTransport;
1394
+ }
1395
+ export interface VLESSUser {
1396
+ name?: string;
1397
+ uuid?: string;
1398
+ flow?: string;
1399
+ }
1400
+ export interface InboundVmessOptions {
1401
+ tag: string;
1402
+ users?: VMessUser[];
1403
+ multiplex?: InboundMultiplexOptions;
1404
+ transport?: V2RayTransport;
1405
+ }
1406
+ export interface VMessUser {
1407
+ name?: string;
1408
+ uuid?: string;
1409
+ alterId?: number;
1410
+ }
1411
+ export interface OutboundAnytlsOptions {
1412
+ tag: string;
1413
+ server?: string;
1414
+ server_port?: number;
1415
+ password?: string;
1416
+ idle_session_check_interval?: Duration;
1417
+ idle_session_timeout?: Duration;
1418
+ min_idle_session?: number;
1419
+ client_metadata?: string;
1420
+ }
1421
+ export interface OutboundAnytlsDial {
1422
+ detour?: Egress;
1423
+ bind_interface?: string;
1424
+ inet4_bind_address?: string;
1425
+ inet6_bind_address?: string;
1426
+ bind_address_no_port?: boolean;
1427
+ protect_path?: string;
1428
+ routing_mark?: number | string;
1429
+ reuse_addr?: boolean;
1430
+ netns?: Namespace | string;
1431
+ connect_timeout?: Duration;
1432
+ tcp_fast_open?: boolean;
1433
+ tcp_multi_path?: boolean;
1434
+ disable_tcp_keep_alive?: boolean;
1435
+ tcp_keep_alive?: Duration;
1436
+ tcp_keep_alive_interval?: Duration;
1437
+ udp_fragment?: boolean;
1438
+ domain_resolver?: DomainResolver;
1439
+ network_strategy?: "default" | "fallback" | "hybrid";
1440
+ network_type?: InterfaceType | InterfaceType[];
1441
+ fallback_network_type?: InterfaceType | InterfaceType[];
1442
+ fallback_delay?: Duration;
1443
+ }
1444
+ export interface OutboundBridgeOptions {
1445
+ tag: string;
1446
+ interface?: string;
1447
+ bridge_name?: string;
1448
+ iproute2_table_index?: number;
1449
+ iproute2_rule_index?: number;
1450
+ }
1451
+ export interface OutboundDirectDial {
1452
+ bind_interface?: string;
1453
+ inet4_bind_address?: string;
1454
+ inet6_bind_address?: string;
1455
+ bind_address_no_port?: boolean;
1456
+ protect_path?: string;
1457
+ routing_mark?: number | string;
1458
+ reuse_addr?: boolean;
1459
+ netns?: Namespace | string;
1460
+ connect_timeout?: Duration;
1461
+ tcp_fast_open?: boolean;
1462
+ tcp_multi_path?: boolean;
1463
+ disable_tcp_keep_alive?: boolean;
1464
+ tcp_keep_alive?: Duration;
1465
+ tcp_keep_alive_interval?: Duration;
1466
+ udp_fragment?: boolean;
1467
+ domain_resolver?: DomainResolver;
1468
+ network_strategy?: "default" | "fallback" | "hybrid";
1469
+ network_type?: InterfaceType | InterfaceType[];
1470
+ fallback_network_type?: InterfaceType | InterfaceType[];
1471
+ fallback_delay?: Duration;
1472
+ }
1473
+ export interface OutboundHttpOptions {
1474
+ tag: string;
1475
+ server?: string;
1476
+ server_port?: number;
1477
+ username?: string;
1478
+ password?: string;
1479
+ path?: string;
1480
+ headers?: HTTPHeader;
1481
+ }
1482
+ export interface OutboundHysteriaOptions {
1483
+ tag: string;
1484
+ server?: string;
1485
+ server_port?: number;
1486
+ server_ports?: string | string[];
1487
+ hop_interval?: Duration;
1488
+ up?: number | string;
1489
+ up_mbps?: number;
1490
+ down?: number | string;
1491
+ down_mbps?: number;
1492
+ obfs?: string;
1493
+ auth?: string | number[];
1494
+ auth_str?: string;
1495
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1496
+ idle_timeout?: Duration;
1497
+ keep_alive_period?: Duration;
1498
+ stream_receive_window?: number | string;
1499
+ connection_receive_window?: number | string;
1500
+ max_concurrent_streams?: number;
1501
+ initial_packet_size?: number;
1502
+ disable_path_mtu_discovery?: boolean;
1503
+ }
1504
+ export interface OutboundHysteria2Options {
1505
+ tag: string;
1506
+ server?: string;
1507
+ server_port?: number;
1508
+ server_ports?: string | string[];
1509
+ hop_interval?: Duration;
1510
+ hop_interval_max?: Duration;
1511
+ up_mbps?: number;
1512
+ down_mbps?: number;
1513
+ obfs?:
1514
+ | {
1515
+ type: "salamander";
1516
+ password?: string;
1517
+ }
1518
+ | {
1519
+ type: "gecko";
1520
+ password?: string;
1521
+ min_packet_size?: number;
1522
+ max_packet_size?: number;
1523
+ };
1524
+ password?: string;
1525
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1526
+ idle_timeout?: Duration;
1527
+ keep_alive_period?: Duration;
1528
+ stream_receive_window?: number | string;
1529
+ connection_receive_window?: number | string;
1530
+ max_concurrent_streams?: number;
1531
+ initial_packet_size?: number;
1532
+ disable_path_mtu_discovery?: boolean;
1533
+ bbr_profile?: "standard" | "conservative" | "aggressive";
1534
+ brutal_debug?: boolean;
1535
+ disable_chrome_parrot?: boolean;
1536
+ realm?: Hysteria2Realm;
1537
+ }
1538
+ export interface Hysteria2Realm {
1539
+ server_url?: string;
1540
+ token?: string;
1541
+ realm_id?: string;
1542
+ stun_servers?: string | string[];
1543
+ ip_version?: 0 | 4 | 6;
1544
+ port_mapping?: Hysteria2RealmPortMapping;
1545
+ http_client?: HTTPClientReference;
1546
+ }
1547
+ export interface OutboundNaiveOptions {
1548
+ tag: string;
1549
+ server?: string;
1550
+ server_port?: number;
1551
+ username?: string;
1552
+ password?: string;
1553
+ insecure_concurrency?: number;
1554
+ extra_headers?: HTTPHeader;
1555
+ stream_receive_window?: number | string;
1556
+ udp_over_tcp?:
1557
+ | boolean
1558
+ | {
1559
+ enabled?: boolean;
1560
+ version?: 1 | 2;
1561
+ };
1562
+ quic?: boolean;
1563
+ quic_congestion_control?: "bbr" | "bbr2" | "cubic" | "reno";
1564
+ quic_session_receive_window?: number | string;
1565
+ }
1566
+ export interface OutboundSelectorOptions {
1567
+ tag: string;
1568
+ outbounds: Egress[];
1569
+ default?: Egress;
1570
+ interrupt_exist_connections?: boolean;
1571
+ }
1572
+ export interface OutboundShadowsocksOptions {
1573
+ tag: string;
1574
+ server?: string;
1575
+ server_port?: number;
1576
+ method?:
1577
+ | "none"
1578
+ | "aes-128-gcm"
1579
+ | "aes-192-gcm"
1580
+ | "aes-256-gcm"
1581
+ | "chacha20-ietf-poly1305"
1582
+ | "xchacha20-ietf-poly1305"
1583
+ | "2022-blake3-aes-128-gcm"
1584
+ | "2022-blake3-aes-256-gcm"
1585
+ | "2022-blake3-chacha20-poly1305"
1586
+ | "aes-128-ctr"
1587
+ | "aes-192-ctr"
1588
+ | "aes-256-ctr"
1589
+ | "aes-128-cfb"
1590
+ | "aes-192-cfb"
1591
+ | "aes-256-cfb"
1592
+ | "rc4-md5"
1593
+ | "chacha20-ietf"
1594
+ | "xchacha20";
1595
+ password?: string;
1596
+ plugin?: string;
1597
+ plugin_opts?: string;
1598
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1599
+ udp_over_tcp?:
1600
+ | boolean
1601
+ | {
1602
+ enabled?: boolean;
1603
+ version?: 1 | 2;
1604
+ };
1605
+ multiplex?: OutboundMultiplexOptions;
1606
+ }
1607
+ export interface OutboundMultiplexOptions {
1608
+ enabled?: boolean;
1609
+ protocol?: "h2mux" | "smux" | "yamux";
1610
+ max_connections?: number;
1611
+ min_streams?: number;
1612
+ max_streams?: number;
1613
+ padding?: boolean;
1614
+ brutal?: BrutalOptions;
1615
+ }
1616
+ export interface OutboundShadowtlsOptions {
1617
+ tag: string;
1618
+ server?: string;
1619
+ server_port?: number;
1620
+ version?: 1 | 2 | 3;
1621
+ password?: string;
1622
+ }
1623
+ export interface OutboundSocksOptions {
1624
+ tag: string;
1625
+ server?: string;
1626
+ server_port?: number;
1627
+ version?: "4" | "4a" | "5";
1628
+ username?: string;
1629
+ password?: string;
1630
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1631
+ udp_over_tcp?:
1632
+ | boolean
1633
+ | {
1634
+ enabled?: boolean;
1635
+ version?: 1 | 2;
1636
+ };
1637
+ }
1638
+ export interface OutboundSshOptions {
1639
+ tag: string;
1640
+ server?: string;
1641
+ server_port?: number;
1642
+ user?: string;
1643
+ password?: string;
1644
+ private_key?: string | string[];
1645
+ private_key_path?: string;
1646
+ private_key_passphrase?: string;
1647
+ host_key?: string | string[];
1648
+ host_key_algorithms?: string | string[];
1649
+ client_version?: string;
1650
+ cipher?: string | string[];
1651
+ mac?: string | string[];
1652
+ kex_algorithm?: string | string[];
1653
+ }
1654
+ export interface OutboundTorOptions {
1655
+ tag: string;
1656
+ executable_path?: string;
1657
+ extra_args?: string[];
1658
+ data_directory?: string;
1659
+ torrc?: {
1660
+ [k: string]: string;
1661
+ };
1662
+ }
1663
+ export interface OutboundTrojanOptions {
1664
+ tag: string;
1665
+ server?: string;
1666
+ server_port?: number;
1667
+ password?: string;
1668
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1669
+ multiplex?: OutboundMultiplexOptions;
1670
+ transport?: V2RayTransport;
1671
+ }
1672
+ export interface OutboundTuicOptions {
1673
+ tag: string;
1674
+ server?: string;
1675
+ server_port?: number;
1676
+ uuid?: string;
1677
+ password?: string;
1678
+ congestion_control?: "cubic" | "new_reno" | "bbr";
1679
+ udp_relay_mode?: "native" | "quic";
1680
+ udp_over_stream?: boolean;
1681
+ zero_rtt_handshake?: boolean;
1682
+ heartbeat?: Duration;
1683
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1684
+ idle_timeout?: Duration;
1685
+ keep_alive_period?: Duration;
1686
+ stream_receive_window?: number | string;
1687
+ connection_receive_window?: number | string;
1688
+ max_concurrent_streams?: number;
1689
+ initial_packet_size?: number;
1690
+ disable_path_mtu_discovery?: boolean;
1691
+ }
1692
+ export interface OutboundUrltestOptions {
1693
+ tag: string;
1694
+ outbounds: Egress[];
1695
+ url?: string;
1696
+ interval?: Duration;
1697
+ tolerance?: number;
1698
+ idle_timeout?: Duration;
1699
+ interrupt_exist_connections?: boolean;
1700
+ }
1701
+ export interface OutboundVlessOptions {
1702
+ tag: string;
1703
+ server: string;
1704
+ server_port: number;
1705
+ uuid: string;
1706
+ flow?: string;
1707
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1708
+ multiplex?: OutboundMultiplexOptions;
1709
+ transport?: V2RayTransport;
1710
+ packet_encoding?: string;
1711
+ }
1712
+ export interface OutboundVmessOptions {
1713
+ tag: string;
1714
+ server?: string;
1715
+ server_port?: number;
1716
+ uuid?: string;
1717
+ security?: "auto" | "none" | "zero" | "aes-128-cfb" | "aes-128-gcm" | "chacha20-poly1305";
1718
+ alter_id?: number;
1719
+ global_padding?: boolean;
1720
+ authenticated_length?: boolean;
1721
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
1722
+ packet_encoding?: "packetaddr" | "xudp";
1723
+ multiplex?: OutboundMultiplexOptions;
1724
+ transport?: V2RayTransport;
1725
+ }
1726
+ export interface EndpointOpenconnectOptions {
1727
+ tag: string;
1728
+ system?: boolean;
1729
+ name?: string;
1730
+ udp_timeout?: Duration;
1731
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1732
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1733
+ udp_nat_max?: number;
1734
+ server?: string;
1735
+ flavor?: "anyconnect" | "gp" | "fortinet" | "f5" | "pulse" | "nc";
1736
+ username?: string;
1737
+ password?: string;
1738
+ auth_group?: string;
1739
+ cookie?: string;
1740
+ token?: OpenConnectTokenOptions;
1741
+ reported_os?: string;
1742
+ user_agent?: string;
1743
+ version?: string;
1744
+ local_hostname?: string;
1745
+ mobile?: OpenConnectMobileOptions;
1746
+ csd?: OpenConnectCSDOptions;
1747
+ hip?: OpenConnectHIPOptions;
1748
+ tncc?: OpenConnectTNCCOptions;
1749
+ fortinet_host_check?: OpenConnectFortinetHostCheckOptions;
1750
+ no_udp?: boolean;
1751
+ dtls_local_port?: number;
1752
+ compression_disabled?: boolean;
1753
+ compression_mode?: "stateless" | "all";
1754
+ ipv6_disabled?: boolean;
1755
+ http_keepalive_disabled?: boolean;
1756
+ xml_post_disabled?: boolean;
1757
+ external_auth_disabled?: boolean;
1758
+ password_authentication_disabled?: boolean;
1759
+ tcp_keep_alive_enabled?: boolean;
1760
+ pfs?: boolean;
1761
+ mtu?: number;
1762
+ base_mtu?: number;
1763
+ dpd_interval?: Duration;
1764
+ reconnect_timeout?: Duration;
1765
+ trojan_interval?: Duration;
1766
+ queue_length?: number;
1767
+ allow_insecure_crypto?: boolean;
1768
+ form_entries?: OpenConnectFormEntryOptions[];
1769
+ }
1770
+ export interface OpenConnectTokenOptions {
1771
+ mode?: "totp" | "hotp" | "stoken" | "oidc";
1772
+ secret?: string;
1773
+ secret_path?: string;
1774
+ pin?: string;
1775
+ password?: string;
1776
+ device_id?: string;
1777
+ counter?: number;
1778
+ }
1779
+ export interface OpenConnectMobileOptions {
1780
+ platform_version?: string;
1781
+ device_type?: string;
1782
+ device_unique_id?: string;
1783
+ }
1784
+ export interface OpenConnectCSDOptions {
1785
+ wrapper_path?: string;
1786
+ }
1787
+ export interface OpenConnectHIPOptions {
1788
+ wrapper_path?: string;
1789
+ }
1790
+ export interface OpenConnectTNCCOptions {
1791
+ wrapper_path?: string;
1792
+ device_id?: string;
1793
+ user_agent?: string;
1794
+ machine_identification_enabled?: boolean;
1795
+ certificates?: OpenConnectTNCCCertificateOptions[];
1796
+ }
1797
+ export interface OpenConnectTNCCCertificateOptions {
1798
+ certificate?: string | string[];
1799
+ certificate_path?: string;
1800
+ }
1801
+ export interface OpenConnectFortinetHostCheckOptions {
1802
+ hostcheck?: string;
1803
+ check_virtual_desktop?: string;
1804
+ }
1805
+ export interface OpenConnectFormEntryOptions {
1806
+ form_id?: string;
1807
+ submission_key?: string;
1808
+ name?: string;
1809
+ value?: string;
1810
+ promote?: boolean;
1811
+ }
1812
+ export interface OpenConnectTLSOptions {
1813
+ insecure?: boolean;
1814
+ server_name?: string;
1815
+ peer_fingerprint?: string | string[];
1816
+ system_trust_disabled?: boolean;
1817
+ certificate_authority?: string | string[];
1818
+ certificate_authority_path?: string;
1819
+ client_certificate?: string | string[];
1820
+ client_certificate_path?: string;
1821
+ client_key?: string | string[];
1822
+ client_key_path?: string;
1823
+ client_key_password?: string;
1824
+ mca_certificate?: string | string[];
1825
+ mca_certificate_path?: string;
1826
+ mca_key?: string | string[];
1827
+ mca_key_path?: string;
1828
+ mca_key_password?: string;
1829
+ }
1830
+ export interface EndpointOpenvpnClientOptions {
1831
+ tag: string;
1832
+ server?: string;
1833
+ server_port?: number;
1834
+ system?: boolean;
1835
+ name?: string;
1836
+ mtu?: number;
1837
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1838
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1839
+ udp_nat_max?: number;
1840
+ mode?: "tls" | "static_key";
1841
+ network?: "udp" | "udp4" | "udp6" | "tcp" | "tcp4" | "tcp6";
1842
+ servers?: OpenVPNRemoteOptions[];
1843
+ remote_random?: boolean;
1844
+ address?: string | string[];
1845
+ peer_address?: string;
1846
+ peer_address_ipv6?: string;
1847
+ topology?: "net30" | "p2p" | "subnet";
1848
+ username?: string;
1849
+ password?: string;
1850
+ auth_retry?: "none" | "nointeract" | "interact";
1851
+ static_challenge?: string;
1852
+ static_challenge_echo?: boolean;
1853
+ static_key?: string | string[];
1854
+ static_key_path?: string;
1855
+ key_direction?: "server" | "client";
1856
+ cipher?: string;
1857
+ data_ciphers?: string | string[];
1858
+ data_ciphers_fallback?: string;
1859
+ auth?: string;
1860
+ mss_fix?: number;
1861
+ mss_fix_disabled?: boolean;
1862
+ mss_fix_mode?: "mtu" | "fixed";
1863
+ fragment?: number;
1864
+ replay_window?: number;
1865
+ replay_window_time?: Duration;
1866
+ compression?: "none" | "no" | "lz4" | "lz4-v2" | "stub" | "stub-v2" | "disabled" | "off";
1867
+ compression_lzo?: "none" | "no" | "yes" | "adaptive" | "asym" | "disabled" | "off";
1868
+ allow_compression?: "no" | "asym" | "yes";
1869
+ route_no_pull?: boolean;
1870
+ pull_filters?: OpenVPNPullFilterOptions[];
1871
+ routes?: string | string[];
1872
+ route_gateway?: string;
1873
+ route_metric?: number;
1874
+ redirect_gateway?: boolean;
1875
+ redirect_gateway_flags?: string | string[];
1876
+ redirect_private?: boolean;
1877
+ block_ipv6?: boolean;
1878
+ ping_interval?: Duration;
1879
+ ping_restart?: Duration;
1880
+ ping_restart_disabled?: boolean;
1881
+ renegotiate_interval?: Duration;
1882
+ renegotiate_disabled?: boolean;
1883
+ renegotiate_bytes?: number;
1884
+ renegotiate_packets?: number;
1885
+ tls_timeout?: Duration;
1886
+ handshake_window?: Duration;
1887
+ explicit_exit_notify?: number;
1888
+ udp_timeout?: UDPTimeout;
1889
+ }
1890
+ export interface OpenVPNRemoteOptions {
1891
+ server?: string;
1892
+ server_port?: number;
1893
+ network?: "udp" | "udp4" | "udp6" | "tcp" | "tcp4" | "tcp6";
1894
+ }
1895
+ export interface OpenVPNPullFilterOptions {
1896
+ action?: "accept" | "ignore" | "reject";
1897
+ text?: string;
1898
+ }
1899
+ export interface OpenVPNOutboundTLSOptions {
1900
+ server_name?: string;
1901
+ server_name_type?: "subject" | "name" | "name-prefix";
1902
+ certificate?: string | string[];
1903
+ certificate_path?: string;
1904
+ client_certificate?: string | string[];
1905
+ client_certificate_path?: string;
1906
+ client_key?: string | string[];
1907
+ client_key_path?: string;
1908
+ peer_fingerprint?: string | string[];
1909
+ crl_path?: string;
1910
+ remote_certificate_ku?: string | string[];
1911
+ remote_certificate_eku?: string;
1912
+ remote_certificate_tls?: "server" | "client" | "none";
1913
+ certificate_profile?: "legacy" | "preferred" | "insecure" | "suiteb";
1914
+ ns_certificate_type?: "server" | "client";
1915
+ version_min?: "1.0" | "1.1" | "1.2" | "1.3";
1916
+ version_max?: "1.0" | "1.1" | "1.2" | "1.3";
1917
+ cipher?: string;
1918
+ groups?: string;
1919
+ control_wrap?: OpenVPNControlWrapOptions;
1920
+ }
1921
+ export interface OpenVPNControlWrapOptions {
1922
+ type?: "tls_auth" | "tls_crypt" | "tls_crypt_v2";
1923
+ key?: string | string[];
1924
+ key_path?: string;
1925
+ direction?: "server" | "client";
1926
+ }
1927
+ export interface EndpointOpenvpnServerOptions {
1928
+ tag: string;
1929
+ system?: boolean;
1930
+ name?: string;
1931
+ mtu?: number;
1932
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1933
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
1934
+ udp_nat_max?: number;
1935
+ mode?: "tls" | "static_key";
1936
+ network?: "tcp" | "udp";
1937
+ remote?: string;
1938
+ remote_port?: number;
1939
+ max_clients?: number;
1940
+ address?: string | string[];
1941
+ peer_address?: string;
1942
+ peer_address_ipv6?: string;
1943
+ topology?: "net30" | "p2p" | "subnet";
1944
+ duplicate_cn?: boolean;
1945
+ users?: User[];
1946
+ static_key?: string | string[];
1947
+ static_key_path?: string;
1948
+ key_direction?: "server" | "client";
1949
+ cipher?: string;
1950
+ data_ciphers?: string | string[];
1951
+ data_ciphers_fallback?: string;
1952
+ auth?: string;
1953
+ mss_fix?: number;
1954
+ mss_fix_disabled?: boolean;
1955
+ mss_fix_mode?: "mtu" | "fixed";
1956
+ replay_window?: number;
1957
+ replay_window_time?: Duration;
1958
+ push?: OpenVPNPushOptions;
1959
+ ping_interval?: Duration;
1960
+ ping_restart?: Duration;
1961
+ renegotiate_interval?: Duration;
1962
+ renegotiate_disabled?: boolean;
1963
+ renegotiate_bytes?: number;
1964
+ renegotiate_packets?: number;
1965
+ handshake_window?: Duration;
1966
+ }
1967
+ export interface OpenVPNPushOptions {
1968
+ routes?: string | string[];
1969
+ dns?: string | string[];
1970
+ dns_servers?: OpenVPNPushDNSServerOptions[];
1971
+ search_domains?: string | string[];
1972
+ dhcp_options?: string | string[];
1973
+ redirect_gateway?: boolean;
1974
+ redirect_gateway_flags?: string | string[];
1975
+ block_outside_dns?: boolean;
1976
+ ping_interval?: Duration;
1977
+ ping_restart?: Duration;
1978
+ }
1979
+ export interface OpenVPNPushDNSServerOptions {
1980
+ priority?: number;
1981
+ addresses?: string | string[];
1982
+ resolve_domains?: string | string[];
1983
+ dnssec?: "yes" | "optional" | "no";
1984
+ transport?: "plain" | "dot" | "doh";
1985
+ sni?: string;
1986
+ }
1987
+ export interface OpenVPNInboundTLSOptions {
1988
+ certificate?: string | string[];
1989
+ certificate_path?: string;
1990
+ key?: string | string[];
1991
+ key_path?: string;
1992
+ client_certificate?: string | string[];
1993
+ client_certificate_path?: string;
1994
+ verify_client_certificate?: "require" | "optional" | "none";
1995
+ client_name?: string;
1996
+ client_name_type?: "subject" | "name" | "name-prefix";
1997
+ peer_fingerprint?: string | string[];
1998
+ crl_path?: string;
1999
+ remote_certificate_ku?: string | string[];
2000
+ remote_certificate_eku?: string;
2001
+ remote_certificate_tls?: "server" | "client" | "none";
2002
+ certificate_profile?: "legacy" | "preferred" | "insecure" | "suiteb";
2003
+ ns_certificate_type?: "server" | "client";
2004
+ version_min?: "1.0" | "1.1" | "1.2" | "1.3";
2005
+ version_max?: "1.0" | "1.1" | "1.2" | "1.3";
2006
+ cipher?: string;
2007
+ groups?: string;
2008
+ control_wrap?: OpenVPNInboundControlWrapOptions;
2009
+ }
2010
+ export interface OpenVPNInboundControlWrapOptions {
2011
+ type?: "tls_auth" | "tls_crypt" | "tls_crypt_v2";
2012
+ key?: string | string[];
2013
+ key_path?: string;
2014
+ direction?: "server" | "client";
2015
+ force_cookie?: boolean;
2016
+ }
2017
+ export interface EndpointTailscaleOptions {
2018
+ tag: string;
2019
+ state_directory?: string;
2020
+ auth_key?: string;
2021
+ control_url?: string;
2022
+ ephemeral?: boolean;
2023
+ hostname?: string;
2024
+ accept_routes?: boolean;
2025
+ exit_node?: string;
2026
+ exit_node_allow_lan_access?: boolean;
2027
+ advertise_routes?: string[];
2028
+ advertise_exit_node?: boolean;
2029
+ advertise_tags?: string | string[];
2030
+ listen_port?: number;
2031
+ relay_server_port?: number;
2032
+ relay_server_static_endpoints?: string[];
2033
+ system_interface?: boolean;
2034
+ system_interface_name?: string;
2035
+ system_interface_mtu?: number;
2036
+ udp_timeout?: UDPTimeout;
2037
+ ssh_server?:
2038
+ | boolean
2039
+ | {
2040
+ enabled?: boolean;
2041
+ disable_pty?: boolean;
2042
+ disable_sftp?: boolean;
2043
+ disable_forwarding?: boolean;
2044
+ };
2045
+ taildrop_directory?: string;
2046
+ }
2047
+ export interface EndpointWireguardOptions {
2048
+ tag: string;
2049
+ system?: boolean;
2050
+ name?: string;
2051
+ mtu?: number;
2052
+ address: string | string[];
2053
+ private_key: string;
2054
+ listen_port?: number;
2055
+ peers?: WireGuardPeer[];
2056
+ udp_timeout?: Duration;
2057
+ udp_mapping?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
2058
+ udp_filtering?: "" | "endpoint_independent" | "address_dependent" | "address_and_port_dependent";
2059
+ udp_nat_max?: number;
2060
+ workers?: number;
2061
+ }
2062
+ export interface WireGuardPeer {
2063
+ address?: string;
2064
+ port?: number;
2065
+ public_key?: string;
2066
+ pre_shared_key?: string;
2067
+ allowed_ips?: string | string[];
2068
+ persistent_keepalive_interval?: number;
2069
+ reserved?: string | number[];
2070
+ }
2071
+ export interface ServiceApiOptions {
2072
+ tag?: string;
2073
+ secret?: string;
2074
+ access_control_allow_origin?: string | string[];
2075
+ access_control_allow_private_network?: boolean;
2076
+ dashboard?:
2077
+ | boolean
2078
+ | string
2079
+ | {
2080
+ enabled?: boolean;
2081
+ path?: string;
2082
+ download_url?: string;
2083
+ http_client?: HTTPClientReference;
2084
+ update_interval?: Duration;
2085
+ };
2086
+ }
2087
+ export interface ServiceCcmOptions {
2088
+ tag?: string;
2089
+ credential_path?: string;
2090
+ users?: CCMUser[];
2091
+ headers?: HTTPHeader;
2092
+ usages_path?: string;
2093
+ }
2094
+ export interface CCMUser {
2095
+ name?: string;
2096
+ token?: string;
2097
+ }
2098
+ export interface ServiceCcmListen {
2099
+ port?: number;
2100
+ bind_interface?: string;
2101
+ routing_mark?: number | string;
2102
+ reuse_addr?: boolean;
2103
+ netns?: Namespace | string;
2104
+ disable_tcp_keep_alive?: boolean;
2105
+ tcp_keep_alive?: Duration;
2106
+ tcp_keep_alive_interval?: Duration;
2107
+ tcp_fast_open?: boolean;
2108
+ tcp_multi_path?: boolean;
2109
+ udp_fragment?: boolean;
2110
+ udp_timeout?: UDPTimeout;
2111
+ detour?: Egress;
2112
+ }
2113
+ export interface ServiceDerpOptions {
2114
+ tag?: string;
2115
+ config_path?: string;
2116
+ verify_client_endpoint?: TailscaleEndpoint | TailscaleEndpoint[];
2117
+ verify_client_url?:
2118
+ | (
2119
+ | string
2120
+ | {
2121
+ tag?: string;
2122
+ engine?: "go" | "apple";
2123
+ version?: 0 | 1 | 2 | 3;
2124
+ disable_version_fallback?: boolean;
2125
+ headers?: HTTPHeader;
2126
+ tls?: OutboundTLSOptions;
2127
+ detour?: Egress;
2128
+ bind_interface?: string;
2129
+ inet4_bind_address?: string;
2130
+ inet6_bind_address?: string;
2131
+ bind_address_no_port?: boolean;
2132
+ protect_path?: string;
2133
+ routing_mark?: number | string;
2134
+ reuse_addr?: boolean;
2135
+ netns?: Namespace | string;
2136
+ connect_timeout?: Duration;
2137
+ tcp_fast_open?: boolean;
2138
+ tcp_multi_path?: boolean;
2139
+ disable_tcp_keep_alive?: boolean;
2140
+ tcp_keep_alive?: Duration;
2141
+ tcp_keep_alive_interval?: Duration;
2142
+ udp_fragment?: boolean;
2143
+ domain_resolver?: DomainResolver;
2144
+ network_strategy?: "default" | "fallback" | "hybrid";
2145
+ network_type?: InterfaceType | InterfaceType[];
2146
+ fallback_network_type?: InterfaceType | InterfaceType[];
2147
+ fallback_delay?: Duration;
2148
+ idle_timeout?: Duration;
2149
+ keep_alive_period?: Duration;
2150
+ stream_receive_window?: number | string;
2151
+ connection_receive_window?: number | string;
2152
+ max_concurrent_streams?: number;
2153
+ initial_packet_size?: number;
2154
+ disable_path_mtu_discovery?: boolean;
2155
+ url?: string;
2156
+ }
2157
+ )
2158
+ | (
2159
+ | string
2160
+ | {
2161
+ tag?: string;
2162
+ engine?: "go" | "apple";
2163
+ version?: 0 | 1 | 2 | 3;
2164
+ disable_version_fallback?: boolean;
2165
+ headers?: HTTPHeader;
2166
+ tls?: OutboundTLSOptions;
2167
+ detour?: Egress;
2168
+ bind_interface?: string;
2169
+ inet4_bind_address?: string;
2170
+ inet6_bind_address?: string;
2171
+ bind_address_no_port?: boolean;
2172
+ protect_path?: string;
2173
+ routing_mark?: number | string;
2174
+ reuse_addr?: boolean;
2175
+ netns?: Namespace | string;
2176
+ connect_timeout?: Duration;
2177
+ tcp_fast_open?: boolean;
2178
+ tcp_multi_path?: boolean;
2179
+ disable_tcp_keep_alive?: boolean;
2180
+ tcp_keep_alive?: Duration;
2181
+ tcp_keep_alive_interval?: Duration;
2182
+ udp_fragment?: boolean;
2183
+ domain_resolver?: DomainResolver;
2184
+ network_strategy?: "default" | "fallback" | "hybrid";
2185
+ network_type?: InterfaceType | InterfaceType[];
2186
+ fallback_network_type?: InterfaceType | InterfaceType[];
2187
+ fallback_delay?: Duration;
2188
+ idle_timeout?: Duration;
2189
+ keep_alive_period?: Duration;
2190
+ stream_receive_window?: number | string;
2191
+ connection_receive_window?: number | string;
2192
+ max_concurrent_streams?: number;
2193
+ initial_packet_size?: number;
2194
+ disable_path_mtu_discovery?: boolean;
2195
+ url?: string;
2196
+ }
2197
+ )[];
2198
+ home?: string;
2199
+ mesh_with?: DERPMeshOptions | DERPMeshOptions[];
2200
+ mesh_psk?: string;
2201
+ mesh_psk_file?: string;
2202
+ stun?:
2203
+ | number
2204
+ | {
2205
+ enabled?: boolean;
2206
+ listen?: string;
2207
+ listen_port?: number;
2208
+ bind_interface?: string;
2209
+ routing_mark?: number | string;
2210
+ reuse_addr?: boolean;
2211
+ netns?: Namespace | string;
2212
+ disable_tcp_keep_alive?: boolean;
2213
+ tcp_keep_alive?: Duration;
2214
+ tcp_keep_alive_interval?: Duration;
2215
+ tcp_fast_open?: boolean;
2216
+ tcp_multi_path?: boolean;
2217
+ udp_fragment?: boolean;
2218
+ udp_timeout?: UDPTimeout;
2219
+ detour?: ListenDetour;
2220
+ };
2221
+ }
2222
+ export interface DERPMeshOptions {
2223
+ server?: string;
2224
+ server_port?: number;
2225
+ host?: string;
2226
+ tls?: OutboundTLSOptions;
2227
+ detour?: Egress;
2228
+ bind_interface?: string;
2229
+ inet4_bind_address?: string;
2230
+ inet6_bind_address?: string;
2231
+ bind_address_no_port?: boolean;
2232
+ protect_path?: string;
2233
+ routing_mark?: number | string;
2234
+ reuse_addr?: boolean;
2235
+ netns?: Namespace | string;
2236
+ connect_timeout?: Duration;
2237
+ tcp_fast_open?: boolean;
2238
+ tcp_multi_path?: boolean;
2239
+ disable_tcp_keep_alive?: boolean;
2240
+ tcp_keep_alive?: Duration;
2241
+ tcp_keep_alive_interval?: Duration;
2242
+ udp_fragment?: boolean;
2243
+ domain_resolver?: DomainResolver;
2244
+ network_strategy?: "default" | "fallback" | "hybrid";
2245
+ network_type?: InterfaceType | InterfaceType[];
2246
+ fallback_network_type?: InterfaceType | InterfaceType[];
2247
+ fallback_delay?: Duration;
2248
+ }
2249
+ export interface ServiceHysteriaRealmOptions {
2250
+ tag?: string;
2251
+ idle_timeout?: Duration;
2252
+ keep_alive_period?: Duration;
2253
+ stream_receive_window?: number | string;
2254
+ connection_receive_window?: number | string;
2255
+ max_concurrent_streams?: number;
2256
+ users?: HysteriaRealmUser[];
2257
+ }
2258
+ export interface HysteriaRealmUser {
2259
+ name?: string;
2260
+ token?: string;
2261
+ max_realms?: number;
2262
+ }
2263
+ export interface ServiceOcmOptions {
2264
+ tag?: string;
2265
+ credential_path?: string;
2266
+ users?: OCMUser[];
2267
+ headers?: HTTPHeader;
2268
+ usages_path?: string;
2269
+ }
2270
+ export interface OCMUser {
2271
+ name?: string;
2272
+ token?: string;
2273
+ }
2274
+ export interface ServiceOomKillerOptions {
2275
+ tag?: string;
2276
+ memory_limit?: number | string;
2277
+ safety_margin?: number | string;
2278
+ min_interval?: Duration;
2279
+ max_interval?: Duration;
2280
+ }
2281
+ export interface ServiceResolvedOptions {
2282
+ tag?: string;
2283
+ }
2284
+ export interface ServiceSsmApiOptions {
2285
+ tag?: string;
2286
+ servers: {
2287
+ [k: string]: SsmInbound;
2288
+ };
2289
+ cache_path?: string;
2290
+ }
2291
+ export interface ServiceUsbipClientOptions {
2292
+ tag?: string;
2293
+ server?: string;
2294
+ server_port?: number;
2295
+ devices?: USBIPDeviceMatch[];
2296
+ }
2297
+ export interface USBIPDeviceMatch {
2298
+ bus_id?: string;
2299
+ vendor_id?: number;
2300
+ product_id?: number;
2301
+ serial?: string;
2302
+ }
2303
+ export interface HTTPClientHttpClientOptions {
2304
+ tag?: string;
2305
+ engine?: "go" | "apple";
2306
+ version?: 0 | 1 | 2 | 3;
2307
+ disable_version_fallback?: boolean;
2308
+ headers?: HTTPHeader;
2309
+ idle_timeout?: Duration;
2310
+ keep_alive_period?: Duration;
2311
+ stream_receive_window?: number | string;
2312
+ connection_receive_window?: number | string;
2313
+ max_concurrent_streams?: number;
2314
+ initial_packet_size?: number;
2315
+ disable_path_mtu_discovery?: boolean;
2316
+ }
2317
+ export interface DNSServerDhcpOptions {
2318
+ tag: string;
2319
+ prefer_go?: boolean;
2320
+ neighbor_domain?: string | string[];
2321
+ interface?: string;
2322
+ }
2323
+ export interface DNSServerFakeipOptions {
2324
+ tag: string;
2325
+ inet4_range?: string;
2326
+ inet6_range?: string;
2327
+ }
2328
+ export interface DNSServerH3Options {
2329
+ tag: string;
2330
+ server?: string;
2331
+ server_port?: number;
2332
+ path?: string;
2333
+ method?: string;
2334
+ headers?: HTTPHeader;
2335
+ }
2336
+ export interface DNSServerHostsOptions {
2337
+ tag: string;
2338
+ path?: string | string[];
2339
+ predefined?: {
2340
+ [k: string]: string | string[];
2341
+ };
2342
+ }
2343
+ export interface DNSServerHttpsOptions {
2344
+ tag: string;
2345
+ server: string;
2346
+ server_port?: number;
2347
+ path?: string;
2348
+ method?: string;
2349
+ headers?: HTTPHeader;
2350
+ }
2351
+ export interface DNSServerLocalOptions {
2352
+ tag: string;
2353
+ prefer_go?: boolean;
2354
+ neighbor_domain?: string | string[];
2355
+ }
2356
+ export interface DNSServerMdnsOptions {
2357
+ tag: string;
2358
+ prefer_go?: boolean;
2359
+ neighbor_domain?: string | string[];
2360
+ interface?: string | string[];
2361
+ }
2362
+ export interface DNSServerOpenconnectOptions {
2363
+ tag: string;
2364
+ endpoint: OpenConnectEndpoint;
2365
+ accept_default_resolvers?: boolean;
2366
+ accept_search_domain?: boolean;
2367
+ }
2368
+ export interface DNSServerOpenvpnOptions {
2369
+ tag: string;
2370
+ endpoint: OpenVpnClientEndpoint;
2371
+ accept_default_resolvers?: boolean;
2372
+ accept_search_domain?: boolean;
2373
+ }
2374
+ export interface DNSServerQuicOptions {
2375
+ tag: string;
2376
+ server?: string;
2377
+ server_port?: number;
2378
+ }
2379
+ export interface DNSServerResolvedOptions {
2380
+ tag: string;
2381
+ service: ResolvedService;
2382
+ accept_default_resolvers?: boolean;
2383
+ }
2384
+ export interface DNSServerTailscaleOptions {
2385
+ tag: string;
2386
+ endpoint: TailscaleEndpoint;
2387
+ accept_default_resolvers?: boolean;
2388
+ accept_search_domain?: boolean;
2389
+ }
2390
+ export interface DNSServerTcpOptions {
2391
+ tag: string;
2392
+ server: string;
2393
+ server_port?: number;
2394
+ }
2395
+ export interface RuleSetInlineOptions {
2396
+ tag: string | string[];
2397
+ rules: HeadlessRule[];
2398
+ }
2399
+ export interface RuleSetLocalOptions {
2400
+ tag: string | string[];
2401
+ format?: "source" | "binary";
2402
+ path: string;
2403
+ }
2404
+ export interface RuleSetRemoteOptions {
2405
+ tag: string | string[];
2406
+ format?: "source" | "binary";
2407
+ url: string;
2408
+ initial_path?: string;
2409
+ http_client?: HTTPClientReference;
2410
+ update_interval?: Duration;
2411
+ }
2412
+ export interface CertificateProviderAcmeOptions {
2413
+ tag: string;
2414
+ domain?: string | string[];
2415
+ data_directory?: string;
2416
+ default_server_name?: string;
2417
+ email?: string;
2418
+ provider?: string;
2419
+ account_key?: string;
2420
+ disable_http_challenge?: boolean;
2421
+ disable_tls_alpn_challenge?: boolean;
2422
+ alternative_http_port?: number;
2423
+ alternative_tls_port?: number;
2424
+ external_account?: ACMEExternalAccountOptions;
2425
+ dns01_challenge?: ACMEProviderDNS01Challenge;
2426
+ key_type?: "ed25519" | "p256" | "p384" | "rsa2048" | "rsa4096";
2427
+ profile?: string;
2428
+ http_client?: HTTPClientReference;
2429
+ }
2430
+ export interface CertificateProviderCloudflareOriginCaOptions {
2431
+ tag: string;
2432
+ domain?: string | string[];
2433
+ data_directory?: string;
2434
+ api_token?: string;
2435
+ origin_ca_key?: string;
2436
+ request_type?: "origin-rsa" | "origin-ecc";
2437
+ requested_validity?: 0 | 7 | 30 | 90 | 365 | 730 | 1095 | 5475;
2438
+ http_client?: HTTPClientReference;
2439
+ }
2440
+ export interface CertificateProviderTailscaleOptions {
2441
+ tag: string;
2442
+ endpoint: TailscaleEndpoint;
2443
+ }
2444
+ export interface NetworkNamespaceDefaultOptions {
2445
+ tag: string;
2446
+ path: string;
2447
+ }
2448
+ export interface NetworkNamespaceUnshareOptions {
2449
+ tag: string;
2450
+ pid_file?: string;
2451
+ }
2452
+ export interface LogOptions {
2453
+ disabled?: boolean;
2454
+ level?: "trace" | "debug" | "info" | "warn" | "warning" | "error" | "fatal" | "panic";
2455
+ output?: string;
2456
+ timestamp?: boolean;
2457
+ }
2458
+ export interface NTPOptions {
2459
+ enabled?: boolean;
2460
+ interval?: Duration;
2461
+ write_to_system?: boolean;
2462
+ server?: string;
2463
+ server_port?: number;
2464
+ detour?: Egress;
2465
+ bind_interface?: string;
2466
+ inet4_bind_address?: string;
2467
+ inet6_bind_address?: string;
2468
+ bind_address_no_port?: boolean;
2469
+ protect_path?: string;
2470
+ routing_mark?: number | string;
2471
+ reuse_addr?: boolean;
2472
+ netns?: Namespace | string;
2473
+ connect_timeout?: Duration;
2474
+ tcp_fast_open?: boolean;
2475
+ tcp_multi_path?: boolean;
2476
+ disable_tcp_keep_alive?: boolean;
2477
+ tcp_keep_alive?: Duration;
2478
+ tcp_keep_alive_interval?: Duration;
2479
+ udp_fragment?: boolean;
2480
+ domain_resolver?: DomainResolver;
2481
+ network_strategy?: "default" | "fallback" | "hybrid";
2482
+ network_type?: InterfaceType | InterfaceType[];
2483
+ fallback_network_type?: InterfaceType | InterfaceType[];
2484
+ fallback_delay?: Duration;
2485
+ }
2486
+ export interface ExperimentalOptions {
2487
+ cache_file?: CacheFileOptions;
2488
+ clash_api?: ClashAPIOptions;
2489
+ v2ray_api?: V2RayAPIOptions;
2490
+ debug?: DebugOptions;
2491
+ }
2492
+ export interface CacheFileOptions {
2493
+ enabled?: boolean;
2494
+ path?: string;
2495
+ cache_id?: string;
2496
+ store_fakeip?: boolean;
2497
+ rdrc_timeout?: Duration;
2498
+ store_dns?: boolean;
2499
+ }
2500
+ export interface ClashAPIOptions {
2501
+ external_controller?: string;
2502
+ external_ui?: string;
2503
+ external_ui_download_url?: string;
2504
+ external_ui_download_detour?: Egress;
2505
+ secret?: string;
2506
+ default_mode?: string;
2507
+ access_control_allow_origin?: string | string[];
2508
+ access_control_allow_private_network?: boolean;
2509
+ }
2510
+ export interface V2RayAPIOptions {
2511
+ listen?: string;
2512
+ stats?: V2RayStatsServiceOptions;
2513
+ }
2514
+ export interface V2RayStatsServiceOptions {
2515
+ enabled?: boolean;
2516
+ inbounds?: string[];
2517
+ outbounds?: string[];
2518
+ users?: string[];
2519
+ }
2520
+ export interface DebugOptions {
2521
+ listen?: string;
2522
+ gc_percent?: number;
2523
+ max_stack?: number;
2524
+ max_threads?: number;
2525
+ panic_on_fault?: boolean;
2526
+ trace_back?: string;
2527
+ memory_limit?: number | string;
2528
+ oom_killer?: boolean;
2529
+ }
2530
+ export interface RouteSettings {
2531
+ final?: Egress;
2532
+ find_process?: boolean;
2533
+ find_neighbor?: boolean;
2534
+ dhcp_lease_files?: string | string[];
2535
+ auto_detect_interface?: boolean;
2536
+ override_android_vpn?: boolean;
2537
+ default_interface?: string;
2538
+ default_mark?: number | string;
2539
+ default_domain_resolver?: DomainResolver;
2540
+ default_network_strategy?: "default" | "fallback" | "hybrid";
2541
+ default_network_type?: InterfaceType | InterfaceType[];
2542
+ default_fallback_network_type?: InterfaceType | InterfaceType[];
2543
+ default_fallback_delay?: Duration;
2544
+ default_http_client?: TaggedHttpClient;
2545
+ }
2546
+ export interface DnsSettings {
2547
+ final?: DnsServer;
2548
+ reverse_mapping?: boolean;
2549
+ strategy?: DomainStrategy;
2550
+ timeout?: Duration;
2551
+ disable_cache?: boolean;
2552
+ disable_expire?: boolean;
2553
+ cache_capacity?: number;
2554
+ optimistic?:
2555
+ | boolean
2556
+ | {
2557
+ enabled?: boolean;
2558
+ timeout?: Duration;
2559
+ };
2560
+ client_subnet?: string;
2561
+ }
2562
+ export interface RouteMatchFields {
2563
+ inbound?: InboundRef | InboundRef[];
2564
+ ip_version?: 4 | 6;
2565
+ network?: ("tcp" | "udp" | "icmp") | ("tcp" | "udp" | "icmp")[];
2566
+ auth_user?: string | string[];
2567
+ protocol?:
2568
+ | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")
2569
+ | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")[];
2570
+ client?: string | string[];
2571
+ domain?: string | string[];
2572
+ domain_suffix?: string | string[];
2573
+ domain_keyword?: string | string[];
2574
+ domain_regex?: string | string[];
2575
+ source_ip_cidr?: string | string[];
2576
+ source_ip_is_private?: boolean;
2577
+ ip_cidr?: string | string[];
2578
+ ip_is_private?: boolean;
2579
+ source_port?: number | number[];
2580
+ source_port_range?: string | string[];
2581
+ port?: number | number[];
2582
+ port_range?: string | string[];
2583
+ process_name?: string | string[];
2584
+ process_path?: string | string[];
2585
+ process_path_regex?: string | string[];
2586
+ package_name?: string | string[];
2587
+ package_name_regex?: string | string[];
2588
+ user?: string | string[];
2589
+ user_id?: number | number[];
2590
+ clash_mode?: string;
2591
+ network_type?: InterfaceType | InterfaceType[];
2592
+ network_is_expensive?: boolean;
2593
+ network_is_constrained?: boolean;
2594
+ wifi_ssid?: string | string[];
2595
+ wifi_bssid?: string | string[];
2596
+ interface_address?: {
2597
+ [k: string]: string | string[];
2598
+ };
2599
+ network_interface_address?: {
2600
+ cellular?: string | string[];
2601
+ ethernet?: string | string[];
2602
+ other?: string | string[];
2603
+ wifi?: string | string[];
2604
+ };
2605
+ default_interface_address?: string | string[];
2606
+ source_mac_address?: string | string[];
2607
+ source_hostname?: string | string[];
2608
+ preferred_by?: PreferredRoutes | PreferredRoutes[];
2609
+ rule_set?: RuleSetRef | RuleSetRef[];
2610
+ rule_set_ip_cidr_match_source?: boolean;
2611
+ invert?: boolean;
2612
+ }
2613
+ export interface DnsMatchFields {
2614
+ inbound?: InboundRef | InboundRef[];
2615
+ ip_version?: 4 | 6;
2616
+ query_type?: DNSQueryType | DNSQueryType[];
2617
+ query_client_subnet?: string | string[];
2618
+ query_dnssec?: boolean;
2619
+ network?: ("tcp" | "udp") | ("tcp" | "udp")[];
2620
+ auth_user?: string | string[];
2621
+ protocol?:
2622
+ | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")
2623
+ | ("tls" | "http" | "quic" | "dns" | "stun" | "bittorrent" | "dtls" | "ssh" | "rdp" | "ntp")[];
2624
+ domain?: string | string[];
2625
+ domain_suffix?: string | string[];
2626
+ domain_keyword?: string | string[];
2627
+ domain_regex?: string | string[];
2628
+ source_ip_cidr?: string | string[];
2629
+ source_ip_is_private?: boolean;
2630
+ source_port?: number | number[];
2631
+ source_port_range?: string | string[];
2632
+ port?: number | number[];
2633
+ port_range?: string | string[];
2634
+ process_name?: string | string[];
2635
+ process_path?: string | string[];
2636
+ process_path_regex?: string | string[];
2637
+ package_name?: string | string[];
2638
+ package_name_regex?: string | string[];
2639
+ user?: string | string[];
2640
+ user_id?: number | number[];
2641
+ clash_mode?: string;
2642
+ network_type?: InterfaceType | InterfaceType[];
2643
+ network_is_expensive?: boolean;
2644
+ network_is_constrained?: boolean;
2645
+ wifi_ssid?: string | string[];
2646
+ wifi_bssid?: string | string[];
2647
+ interface_address?: {
2648
+ [k: string]: string | string[];
2649
+ };
2650
+ network_interface_address?: {
2651
+ cellular?: string | string[];
2652
+ ethernet?: string | string[];
2653
+ other?: string | string[];
2654
+ wifi?: string | string[];
2655
+ };
2656
+ default_interface_address?: string | string[];
2657
+ source_mac_address?: string | string[];
2658
+ source_hostname?: string | string[];
2659
+ preferred_by?: PreferredDomain | PreferredDomain[];
2660
+ rule_set?: RuleSetRef | RuleSetRef[];
2661
+ rule_set_ip_cidr_match_source?: boolean;
2662
+ match_response?: boolean | string;
2663
+ ip_cidr?: string | string[];
2664
+ ip_is_private?: boolean;
2665
+ ip_accept_any?: boolean;
2666
+ response_rcode?: DNSRCode;
2667
+ response_answer?: string | string[];
2668
+ response_ns?: string | string[];
2669
+ response_extra?: string | string[];
2670
+ invert?: boolean;
2671
+ }