sing-box-kit 0.0.0-stage → 0.1.0

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