sub-store-convert 2.14.421 → 2.19.36

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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/build/index.js +1297 -179
  3. package/package.json +3 -2
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Sub-Store/backend/src/utils/index.js
1
+ // src/vendors/Sub-Store/backend/src/utils/index.js
2
2
  import * as ipAddress from "ip-address";
3
3
  var IPV4_REGEX = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/;
4
4
  var IPV6_REGEX = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
@@ -36,7 +36,7 @@ function getRandomPort(portString) {
36
36
  }
37
37
  }
38
38
 
39
- // Sub-Store/backend/src/core/proxy-utils/parsers/peggy/surge.js
39
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/parsers/peggy/surge.js
40
40
  import * as peggy from "peggy";
41
41
  var grammars = String.raw`
42
42
  // global initializer
@@ -76,11 +76,11 @@ var grammars = String.raw`
76
76
  }
77
77
  }
78
78
 
79
- start = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls/tuic/tuic_v5/wireguard/hysteria2/ssh) {
79
+ start = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls/tuic/tuic_v5/wireguard/hysteria2/ssh/direct) {
80
80
  return proxy;
81
81
  }
82
82
 
83
- shadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/udp_port/others)* {
83
+ shadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/udp_port/others)* {
84
84
  proxy.type = "ss";
85
85
  // handle obfs
86
86
  if (obfs.type == "http" || obfs.type === "tls") {
@@ -91,7 +91,7 @@ shadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/
91
91
  }
92
92
  handleShadowTLS();
93
93
  }
94
- vmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
94
+ vmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls/sni/tls_fingerprint/tls_verification/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
95
95
  proxy.type = "vmess";
96
96
  proxy.cipher = proxy.cipher || "none";
97
97
  if (proxy.aead) {
@@ -102,25 +102,25 @@ vmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/
102
102
  handleWebsocket();
103
103
  handleShadowTLS();
104
104
  }
105
- trojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
105
+ trojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
106
106
  proxy.type = "trojan";
107
107
  handleWebsocket();
108
108
  handleShadowTLS();
109
109
  }
110
- https = tag equals "https" address (username password)? (usernamek passwordk)? (sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
110
+ https = tag equals "https" address (username password)? (usernamek passwordk)? (sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
111
111
  proxy.type = "http";
112
112
  proxy.tls = true;
113
113
  handleShadowTLS();
114
114
  }
115
- http = tag equals "http" address (username password)? (usernamek passwordk)? (ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
115
+ http = tag equals "http" address (username password)? (usernamek passwordk)? (ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
116
116
  proxy.type = "http";
117
117
  handleShadowTLS();
118
118
  }
119
- ssh = tag equals "ssh" address (username password)? (usernamek passwordk)? (server_fingerprint/idle_timeout/private_key/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
119
+ ssh = tag equals "ssh" address (username password)? (usernamek passwordk)? (server_fingerprint/idle_timeout/private_key/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
120
120
  proxy.type = "ssh";
121
121
  handleShadowTLS();
122
122
  }
123
- snell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/udp_relay/reuse/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
123
+ snell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/reuse/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
124
124
  proxy.type = "snell";
125
125
  // handle obfs
126
126
  if (obfs.type == "http" || obfs.type === "tls") {
@@ -143,19 +143,22 @@ wireguard = tag equals "wireguard" (section_name/no_error_alert/ip_version/under
143
143
  proxy.type = "wireguard-surge";
144
144
  handleShadowTLS();
145
145
  }
146
- hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
146
+ hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/fast_open/tfo/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
147
147
  proxy.type = "hysteria2";
148
148
  handleShadowTLS();
149
149
  }
150
- socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/fast_open/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
150
+ socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
151
151
  proxy.type = "socks5";
152
152
  handleShadowTLS();
153
153
  }
154
- socks5_tls = tag equals "socks5-tls" address (username password)? (usernamek passwordk)? (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_fingerprint/tls_verification/fast_open/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
154
+ socks5_tls = tag equals "socks5-tls" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_fingerprint/tls_verification/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
155
155
  proxy.type = "socks5";
156
156
  proxy.tls = true;
157
157
  handleShadowTLS();
158
158
  }
159
+ direct = tag equals "direct" (udp_relay/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/block_quic/others)* {
160
+ proxy.type = "direct";
161
+ }
159
162
 
160
163
  address = comma server:server comma port:port {
161
164
  proxy.server = server;
@@ -232,7 +235,7 @@ snell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }
232
235
  snell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }
233
236
 
234
237
  usernamek = comma "username" equals match:[^,]+ { proxy.username = match.join(""); }
235
- passwordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }
238
+ passwordk = comma "password" equals match:[^,]+ { proxy.password = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
236
239
  vmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }
237
240
  vmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }
238
241
 
@@ -282,7 +285,7 @@ block_quic = comma "block-quic" equals match:[^,]+ { proxy["block-quic"] = match
282
285
  udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
283
286
  shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
284
287
  shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
285
- shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
288
+ shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
286
289
  token = comma "token" equals match:[^,]+ { proxy.token = match.join(""); }
287
290
  alpn = comma "alpn" equals match:[^,]+ { proxy.alpn = match.join(""); }
288
291
  uuidk = comma "uuid" equals match:[^,]+ { proxy.uuid = match.join(""); }
@@ -302,7 +305,7 @@ function getParser() {
302
305
  return parser;
303
306
  }
304
307
 
305
- // Sub-Store/backend/src/core/proxy-utils/parsers/peggy/loon.js
308
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/parsers/peggy/loon.js
306
309
  import * as peggy2 from "peggy";
307
310
  var grammars2 = String.raw`
308
311
  // global initializer
@@ -344,12 +347,12 @@ start = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http/socks5/hysteria2
344
347
  return proxy;
345
348
  }
346
349
 
347
- shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{
350
+ shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)*{
348
351
  proxy.type = "ssr";
349
352
  // handle ssr obfs
350
353
  proxy.obfs = obfs.type;
351
354
  }
352
- shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {
355
+ shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)* {
353
356
  proxy.type = "ss";
354
357
  // handle ss obfs
355
358
  if (obfs.type == "http" || obfs.type === "tls") {
@@ -359,31 +362,31 @@ shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs
359
362
  $set(proxy, "plugin-opts.path", obfs.path);
360
363
  }
361
364
  }
362
- vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/others)* {
365
+ vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/ip_mode/public_key/short_id/block_quic/others)* {
363
366
  proxy.type = "vmess";
364
367
  proxy.cipher = proxy.cipher || "none";
365
368
  proxy.alterId = proxy.alterId || 0;
366
369
  handleTransport();
367
370
  }
368
- vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/others)* {
371
+ vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/flow/public_key/short_id/block_quic/others)* {
369
372
  proxy.type = "vless";
370
373
  handleTransport();
371
374
  }
372
- trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/others)* {
375
+ trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
373
376
  proxy.type = "trojan";
374
377
  handleTransport();
375
378
  }
376
- hysteria2 = tag equals "hysteria2"i address password (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/others)* {
379
+ hysteria2 = tag equals "hysteria2"i address password (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/ip_mode/block_quic/others)* {
377
380
  proxy.type = "hysteria2";
378
381
  }
379
- https = tag equals "https"i address (username password)? (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/others)* {
382
+ https = tag equals "https"i address (username password)? (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
380
383
  proxy.type = "http";
381
384
  proxy.tls = true;
382
385
  }
383
- http = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {
386
+ http = tag equals "http"i address (username password)? (fast_open/udp_relay/ip_mode/block_quic/others)* {
384
387
  proxy.type = "http";
385
388
  }
386
- socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/others)* {
389
+ socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
387
390
  proxy.type = "socks5";
388
391
  }
389
392
 
@@ -425,7 +428,7 @@ port = digits:[0-9]+ {
425
428
  method = comma cipher:cipher {
426
429
  proxy.cipher = cipher;
427
430
  }
428
- cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"auto"/"bf-cfb"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"rc4-md5"/"rc4"/"salsa20"/"xchacha20-ietf-poly1305");
431
+ cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"auto"/"bf-cfb"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"rc4-md5"/"rc4"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
429
432
 
430
433
  username = & {
431
434
  let j = peg$currPos;
@@ -474,19 +477,31 @@ ssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protoc
474
477
 
475
478
  vmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); }
476
479
 
480
+ udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
481
+ shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
482
+ shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
483
+ shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
484
+
477
485
  over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
478
486
  tls_host = comma sni:("tls-name"/"sni") equals host:domain { proxy.sni = host; }
479
487
  tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
480
488
  tls_cert_sha256 = comma "tls-cert-sha256" equals match:[^,]+ { proxy["tls-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
481
489
  tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals match:[^,]+ { proxy["tls-pubkey-sha256"] = match.join("").replace(/^"(.*)"$/, '$1'); }
482
490
 
491
+ flow = comma "flow" equals match:[^,]+ { proxy["flow"] = match.join("").replace(/^"(.*)"$/, '$1'); }
492
+ public_key = comma "public-key" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["public-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
493
+ short_id = comma "short-id" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["short-id"] = match.join("").replace(/^"(.*)"$/, '$1'); }
494
+
483
495
  fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
484
496
  udp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }
497
+ ip_mode = comma "ip-mode" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
485
498
 
486
499
  ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
487
500
  download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
488
501
  salamander_password = comma "salamander-password" equals match:[^,]+ { proxy['obfs-password'] = match.join(""); proxy.obfs = 'salamander'; }
489
502
 
503
+ block_quic = comma "block-quic" equals flag:bool { if(flag) proxy["block-quic"] = "on"; else proxy["block-quic"] = "off"; }
504
+
490
505
  tag = match:[^=,]* { proxy.name = match.join("").trim(); }
491
506
  comma = _ "," _
492
507
  equals = _ "=" _
@@ -502,7 +517,7 @@ function getParser2() {
502
517
  return parser2;
503
518
  }
504
519
 
505
- // Sub-Store/backend/src/core/proxy-utils/parsers/peggy/qx.js
520
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/parsers/peggy/qx.js
506
521
  import * as peggy3 from "peggy";
507
522
  var grammars3 = String.raw`
508
523
  // global initializer
@@ -554,7 +569,7 @@ trojan = "trojan" equals address
554
569
  }
555
570
 
556
571
  shadowsocks = "shadowsocks" equals address
557
- (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/server_check_url/others)* {
572
+ (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp_new/fast_open/tag/server_check_url/others)* {
558
573
  if (proxy.protocol || proxy.type === "ssr") {
559
574
  proxy.type = "ssr";
560
575
  if (!proxy.protocol) {
@@ -650,18 +665,20 @@ port = digits:[0-9]+ {
650
665
  }
651
666
  }
652
667
 
653
- username = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }
654
- password = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }
655
- uuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }
668
+ username = comma "username" equals username:[^,]+ { proxy.username = username.join("").trim(); }
669
+ password = comma "password" equals password:[^,]+ { proxy.password = password.join("").trim(); }
670
+ uuid = comma "password" equals uuid:[^,]+ { proxy.uuid = uuid.join("").trim(); }
656
671
 
657
672
  method = comma "method" equals cipher:cipher {
658
673
  proxy.cipher = cipher;
659
674
  };
660
- cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305");
675
+ cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
661
676
  aead = comma "aead" equals flag:bool { proxy.aead = flag; }
662
677
 
663
678
  udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
664
679
  udp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }
680
+ udp_over_tcp_new = comma "udp-over-tcp" equals param:$[^=,]+ { if (param === "sp.v1") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 1; } else if (param === "sp.v2") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 2; } else if (param === "true") { proxy["_ssr_python_uot"] = true; } else { throw new Error("Invalid value for udp-over-tcp"); } }
681
+
665
682
  fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
666
683
 
667
684
  over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
@@ -708,7 +725,7 @@ function getParser3() {
708
725
  return parser3;
709
726
  }
710
727
 
711
- // Sub-Store/backend/src/core/proxy-utils/parsers/peggy/trojan-uri.js
728
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/parsers/peggy/trojan-uri.js
712
729
  import * as peggy4 from "peggy";
713
730
  var grammars4 = String.raw`
714
731
  // global initializer
@@ -791,8 +808,13 @@ port = digits:[0-9]+ {
791
808
  }
792
809
 
793
810
  params = "?" head:param tail:("&"@param)* {
811
+ for (const [key, value] of Object.entries(params)) {
812
+ params[key] = decodeURIComponent(value);
813
+ }
794
814
  proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);
795
815
  proxy.sni = params["sni"] || params["peer"];
816
+ proxy['client-fingerprint'] = params.fp;
817
+ proxy.alpn = params.alpn ? decodeURIComponent(params.alpn).split(',') : undefined;
796
818
 
797
819
  if (toBool(params["ws"])) {
798
820
  proxy.network = "ws";
@@ -810,6 +832,7 @@ params = "?" head:param tail:("&"@param)* {
810
832
  proxy[proxy.network + '-opts'] = {
811
833
  'grpc-service-name': params["serviceName"],
812
834
  '_grpc-type': params["mode"],
835
+ '_grpc-authority': params["authority"],
813
836
  };
814
837
  } else {
815
838
  if (params["path"]) {
@@ -823,6 +846,27 @@ params = "?" head:param tail:("&"@param)* {
823
846
  $set(proxy, proxy.network+"-opts.v2ray-http-upgrade-fast-open", true);
824
847
  }
825
848
  }
849
+ if (['reality'].includes(params.security)) {
850
+ const opts = {};
851
+ if (params.pbk) {
852
+ opts['public-key'] = params.pbk;
853
+ }
854
+ if (params.sid) {
855
+ opts['short-id'] = params.sid;
856
+ }
857
+ if (params.spx) {
858
+ opts['_spider-x'] = params.spx;
859
+ }
860
+ if (params.mode) {
861
+ proxy._mode = params.mode;
862
+ }
863
+ if (params.extra) {
864
+ proxy._extra = params.extra;
865
+ }
866
+ if (Object.keys(opts).length > 0) {
867
+ $set(proxy, params.security+"-opts", opts);
868
+ }
869
+ }
826
870
  }
827
871
 
828
872
  proxy.udp = toBool(params["udp"]);
@@ -851,7 +895,19 @@ function getParser4() {
851
895
  return parser4;
852
896
  }
853
897
 
854
- // Sub-Store/backend/src/core/proxy-utils/parsers/index.js
898
+ // src/core/app/index.js
899
+ var app_default = new Proxy(console, {
900
+ get: function(target, prop) {
901
+ if (prop in target) {
902
+ return target[prop];
903
+ }
904
+ return function() {
905
+ return void 0;
906
+ };
907
+ }
908
+ });
909
+
910
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/parsers/index.js
855
911
  import { Base64 } from "js-base64";
856
912
  function surge_port_hopping(raw) {
857
913
  const [parts, port_hopping] = raw.match(
@@ -862,6 +918,74 @@ function surge_port_hopping(raw) {
862
918
  line: parts ? raw.replace(parts, "") : raw
863
919
  };
864
920
  }
921
+ function URI_PROXY() {
922
+ const name = "URI PROXY Parser";
923
+ const test = (line) => {
924
+ return /^(socks5\+tls|socks5|http|https):\/\//.test(line);
925
+ };
926
+ const parse = (line) => {
927
+ let [__, type, tls, username, password, server, port, query, name2] = line.match(
928
+ /^(socks5|http|http)(\+tls|s)?:\/\/(?:(.*?):(.*?)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/
929
+ );
930
+ if (port) {
931
+ port = parseInt(port, 10);
932
+ } else {
933
+ if (tls) {
934
+ port = 443;
935
+ } else if (type === "http") {
936
+ port = 80;
937
+ } else {
938
+ app_default.error(`port is not present in line: ${line}`);
939
+ throw new Error(`port is not present in line: ${line}`);
940
+ }
941
+ app_default.info(`port is not present in line: ${line}, set to ${port}`);
942
+ }
943
+ const proxy = {
944
+ name: name2 != null ? decodeURIComponent(name2) : `${type} ${server}:${port}`,
945
+ type,
946
+ tls: tls ? true : false,
947
+ server,
948
+ port,
949
+ username: username != null ? decodeURIComponent(username) : void 0,
950
+ password: password != null ? decodeURIComponent(password) : void 0
951
+ };
952
+ return proxy;
953
+ };
954
+ return { name, test, parse };
955
+ }
956
+ function URI_SOCKS() {
957
+ const name = "URI SOCKS Parser";
958
+ const test = (line) => {
959
+ return /^socks:\/\//.test(line);
960
+ };
961
+ const parse = (line) => {
962
+ let [__, type, auth, server, port, query, name2] = line.match(
963
+ /^(socks)?:\/\/(?:(.*)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/
964
+ );
965
+ if (port) {
966
+ port = parseInt(port, 10);
967
+ } else {
968
+ app_default.error(`port is not present in line: ${line}`);
969
+ throw new Error(`port is not present in line: ${line}`);
970
+ }
971
+ let username, password;
972
+ if (auth) {
973
+ const parsed = Base64.decode(decodeURIComponent(auth)).split(":");
974
+ username = parsed[0];
975
+ password = parsed[1];
976
+ }
977
+ const proxy = {
978
+ name: name2 != null ? decodeURIComponent(name2) : `${type} ${server}:${port}`,
979
+ type: "socks5",
980
+ server,
981
+ port,
982
+ username,
983
+ password
984
+ };
985
+ return proxy;
986
+ };
987
+ return { name, test, parse };
988
+ }
865
989
  function URI_SS() {
866
990
  const name = "URI SS Parser";
867
991
  const test = (line) => {
@@ -869,13 +993,19 @@ function URI_SS() {
869
993
  };
870
994
  const parse = (line) => {
871
995
  let content = line.split("ss://")[1];
996
+ let name2 = line.split("#")[1];
872
997
  const proxy = {
873
- name: decodeURIComponent(line.split("#")[1]),
874
998
  type: "ss"
875
999
  };
876
1000
  content = content.split("#")[0];
877
- let serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
878
- let userInfoStr = Base64.decode(content.split("@")[0]);
1001
+ let serverAndPortArray = content.match(/@([^/?]*)(\/|\?|$)/);
1002
+ let rawUserInfoStr = decodeURIComponent(content.split("@")[0]);
1003
+ let userInfoStr;
1004
+ if (rawUserInfoStr?.startsWith("2022-blake3-")) {
1005
+ userInfoStr = rawUserInfoStr;
1006
+ } else {
1007
+ userInfoStr = Base64.decode(rawUserInfoStr);
1008
+ }
879
1009
  let query = "";
880
1010
  if (!serverAndPortArray) {
881
1011
  if (content.includes("?")) {
@@ -897,8 +1027,11 @@ function URI_SS() {
897
1027
  }
898
1028
  content = `${content}${query}`;
899
1029
  }
900
- userInfoStr = content.split("@")[0];
901
- serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
1030
+ userInfoStr = content.match(/(^.*)@/)?.[1];
1031
+ serverAndPortArray = content.match(/@([^/@]*)(\/|$)/);
1032
+ } else if (content.includes("?")) {
1033
+ const parsed = content.match(/(\?.*)$/);
1034
+ query = parsed[1];
902
1035
  }
903
1036
  const serverAndPort = serverAndPortArray[1];
904
1037
  const portIdx = serverAndPort.lastIndexOf(":");
@@ -906,12 +1039,13 @@ function URI_SS() {
906
1039
  proxy.port = `${serverAndPort.substring(portIdx + 1)}`.match(
907
1040
  /\d+/
908
1041
  )?.[0];
909
- const userInfo = userInfoStr.match(/(^.*?):(.*$)/);
910
- proxy.cipher = userInfo[1];
911
- proxy.password = userInfo[2];
912
- const idx = content.indexOf("?plugin=");
913
- if (idx !== -1) {
914
- const pluginInfo = ("plugin=" + decodeURIComponent(content.split("?plugin=")[1].split("&")[0])).split(";");
1042
+ let userInfo = userInfoStr.match(/(^.*?):(.*$)/);
1043
+ proxy.cipher = userInfo?.[1];
1044
+ proxy.password = userInfo?.[2];
1045
+ const pluginMatch = content.match(/[?&]plugin=([^&]+)/);
1046
+ const shadowTlsMatch = content.match(/[?&]shadow-tls=([^&]+)/);
1047
+ if (pluginMatch) {
1048
+ const pluginInfo = ("plugin=" + decodeURIComponent(pluginMatch[1])).split(";");
915
1049
  const params = {};
916
1050
  for (const item of pluginInfo) {
917
1051
  const [key, val] = item.split("=");
@@ -935,18 +1069,50 @@ function URI_SS() {
935
1069
  tls: getIfPresent(params.tls)
936
1070
  };
937
1071
  break;
1072
+ case "shadow-tls": {
1073
+ proxy.plugin = "shadow-tls";
1074
+ const version = getIfNotBlank(params["version"]);
1075
+ proxy["plugin-opts"] = {
1076
+ host: getIfNotBlank(params["host"]),
1077
+ password: getIfNotBlank(params["password"]),
1078
+ version: version ? parseInt(version, 10) : void 0
1079
+ };
1080
+ break;
1081
+ }
938
1082
  default:
939
1083
  throw new Error(
940
1084
  `Unsupported plugin option: ${params.plugin}`
941
1085
  );
942
1086
  }
943
1087
  }
1088
+ if (shadowTlsMatch) {
1089
+ const params = JSON.parse(Base64.decode(shadowTlsMatch[1]));
1090
+ const version = getIfNotBlank(params["version"]);
1091
+ const address = getIfNotBlank(params["address"]);
1092
+ const port = getIfNotBlank(params["port"]);
1093
+ proxy.plugin = "shadow-tls";
1094
+ proxy["plugin-opts"] = {
1095
+ host: getIfNotBlank(params["host"]),
1096
+ password: getIfNotBlank(params["password"]),
1097
+ version: version ? parseInt(version, 10) : void 0
1098
+ };
1099
+ if (address) {
1100
+ proxy.server = address;
1101
+ }
1102
+ if (port) {
1103
+ proxy.port = parseInt(port, 10);
1104
+ }
1105
+ }
944
1106
  if (/(&|\?)uot=(1|true)/i.test(query)) {
945
1107
  proxy["udp-over-tcp"] = true;
946
1108
  }
947
1109
  if (/(&|\?)tfo=(1|true)/i.test(query)) {
948
1110
  proxy.tfo = true;
949
1111
  }
1112
+ if (name2 != null) {
1113
+ name2 = decodeURIComponent(name2);
1114
+ }
1115
+ proxy.name = name2 ?? `SS ${proxy.server}:${proxy.port}`;
950
1116
  return proxy;
951
1117
  };
952
1118
  return { name, test, parse };
@@ -1012,7 +1178,7 @@ function URI_VMess() {
1012
1178
  };
1013
1179
  const parse = (line) => {
1014
1180
  line = line.split("vmess://")[1];
1015
- let content = Base64.decode(line);
1181
+ let content = Base64.decode(line.replace(/\?.*?$/, ""));
1016
1182
  if (/=\s*vmess/.test(content)) {
1017
1183
  const partitions = content.split(",").map((p) => p.trim());
1018
1184
  const params = {};
@@ -1098,8 +1264,12 @@ function URI_VMess() {
1098
1264
  params.allowInsecure
1099
1265
  );
1100
1266
  }
1101
- if (proxy.tls && params.sni && params.sni !== "") {
1102
- proxy.sni = params.sni;
1267
+ if (proxy.tls) {
1268
+ if (params.sni && params.sni !== "") {
1269
+ proxy.sni = params.sni;
1270
+ } else if (params.peer && params.peer !== "") {
1271
+ proxy.sni = params.peer;
1272
+ }
1103
1273
  }
1104
1274
  let httpupgrade = false;
1105
1275
  if (params.net === "ws" || params.obfs === "websocket") {
@@ -1125,6 +1295,9 @@ function URI_VMess() {
1125
1295
  } catch (e) {
1126
1296
  }
1127
1297
  let transportPath = params.path;
1298
+ if (["ws"].includes(proxy.network)) {
1299
+ transportPath = transportPath || "/";
1300
+ }
1128
1301
  if (proxy.network === "http") {
1129
1302
  if (transportHost) {
1130
1303
  transportHost = transportHost.split(",").map((i) => i.trim());
@@ -1140,7 +1313,8 @@ function URI_VMess() {
1140
1313
  if (["grpc"].includes(proxy.network)) {
1141
1314
  proxy[`${proxy.network}-opts`] = {
1142
1315
  "grpc-service-name": getIfNotBlank(transportPath),
1143
- "_grpc-type": getIfNotBlank(params.type)
1316
+ "_grpc-type": getIfNotBlank(params.type),
1317
+ "_grpc-authority": getIfNotBlank(params.authority)
1144
1318
  };
1145
1319
  } else {
1146
1320
  const opts = {
@@ -1225,6 +1399,9 @@ function URI_VLESS() {
1225
1399
  if (params.sid) {
1226
1400
  opts["short-id"] = params.sid;
1227
1401
  }
1402
+ if (params.spx) {
1403
+ opts["_spider-x"] = params.spx;
1404
+ }
1228
1405
  if (Object.keys(opts).length > 0) {
1229
1406
  proxy[`${params.security}-opts`] = opts;
1230
1407
  }
@@ -1239,6 +1416,9 @@ function URI_VLESS() {
1239
1416
  }
1240
1417
  if (!proxy.network && isShadowrocket && params.obfs) {
1241
1418
  proxy.network = params.obfs;
1419
+ if (["none"].includes(proxy.network)) {
1420
+ proxy.network = "tcp";
1421
+ }
1242
1422
  }
1243
1423
  if (["websocket"].includes(proxy.network)) {
1244
1424
  proxy.network = "ws";
@@ -1260,6 +1440,9 @@ function URI_VLESS() {
1260
1440
  }
1261
1441
  if (params.serviceName) {
1262
1442
  opts[`${proxy.network}-service-name`] = params.serviceName;
1443
+ if (["grpc"].includes(proxy.network) && params.authority) {
1444
+ opts["_grpc-authority"] = params.authority;
1445
+ }
1263
1446
  } else if (isShadowrocket && params.path) {
1264
1447
  if (!["ws", "http", "h2"].includes(proxy.network)) {
1265
1448
  opts[`${proxy.network}-service-name`] = params.path;
@@ -1285,6 +1468,55 @@ function URI_VLESS() {
1285
1468
  }
1286
1469
  proxy.headerType = params.headerType || "none";
1287
1470
  }
1471
+ if (params.mode) {
1472
+ proxy._mode = params.mode;
1473
+ }
1474
+ if (params.extra) {
1475
+ proxy._extra = params.extra;
1476
+ }
1477
+ }
1478
+ return proxy;
1479
+ };
1480
+ return { name, test, parse };
1481
+ }
1482
+ function URI_AnyTLS() {
1483
+ const name = "URI AnyTLS Parser";
1484
+ const test = (line) => {
1485
+ return /^anytls:\/\//.test(line);
1486
+ };
1487
+ const parse = (line) => {
1488
+ line = line.split(/anytls:\/\//)[1];
1489
+ let [__, password, server, port, addons = "", name2] = /^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(line);
1490
+ password = decodeURIComponent(password);
1491
+ port = parseInt(`${port}`, 10);
1492
+ if (isNaN(port)) {
1493
+ port = 443;
1494
+ }
1495
+ password = decodeURIComponent(password);
1496
+ if (name2 != null) {
1497
+ name2 = decodeURIComponent(name2);
1498
+ }
1499
+ name2 = name2 ?? `AnyTLS ${server}:${port}`;
1500
+ const proxy = {
1501
+ type: "anytls",
1502
+ name: name2,
1503
+ server,
1504
+ port,
1505
+ password
1506
+ };
1507
+ for (const addon of addons.split("&")) {
1508
+ let [key, value] = addon.split("=");
1509
+ key = key.replace(/_/g, "-");
1510
+ value = decodeURIComponent(value);
1511
+ if (["alpn"].includes(key)) {
1512
+ proxy[key] = value ? value.split(",") : void 0;
1513
+ } else if (["insecure"].includes(key)) {
1514
+ proxy["skip-cert-verify"] = /(TRUE)|1/i.test(value);
1515
+ } else if (["udp"].includes(key)) {
1516
+ proxy[key] = /(TRUE)|1/i.test(value);
1517
+ } else {
1518
+ proxy[key] = value;
1519
+ }
1288
1520
  }
1289
1521
  return proxy;
1290
1522
  };
@@ -1352,11 +1584,21 @@ function URI_Hysteria2() {
1352
1584
  if (params.obfs && params.obfs !== "none") {
1353
1585
  proxy.obfs = params.obfs;
1354
1586
  }
1355
- proxy.ports = params.mport;
1587
+ if (params.mport) {
1588
+ proxy.ports = params.mport;
1589
+ }
1356
1590
  proxy["obfs-password"] = params["obfs-password"];
1357
1591
  proxy["skip-cert-verify"] = /(TRUE)|1/i.test(params.insecure);
1358
1592
  proxy.tfo = /(TRUE)|1/i.test(params.fastopen);
1359
1593
  proxy["tls-fingerprint"] = params.pinSHA256;
1594
+ let hop_interval = params["hop-interval"] || params["hop_interval"];
1595
+ if (/^\d+$/.test(hop_interval)) {
1596
+ proxy["hop-interval"] = parseInt(`${hop_interval}`, 10);
1597
+ }
1598
+ let keepalive = params["keepalive"];
1599
+ if (/^\d+$/.test(keepalive)) {
1600
+ proxy["keepalive"] = parseInt(`${keepalive}`, 10);
1601
+ }
1360
1602
  return proxy;
1361
1603
  };
1362
1604
  return { name, test, parse };
@@ -1430,7 +1672,10 @@ function URI_TUIC() {
1430
1672
  };
1431
1673
  const parse = (line) => {
1432
1674
  line = line.split(/tuic:\/\//)[1];
1433
- let [__, uuid, password, server, ___, port, ____, addons = "", name2] = /^(.*?):(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line);
1675
+ let [__, auth, server, port, addons = "", name2] = /^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(line);
1676
+ auth = decodeURIComponent(auth);
1677
+ let [uuid, ...passwordParts] = auth.split(":");
1678
+ let password = passwordParts.join(":");
1434
1679
  port = parseInt(`${port}`, 10);
1435
1680
  if (isNaN(port)) {
1436
1681
  port = 443;
@@ -1450,14 +1695,19 @@ function URI_TUIC() {
1450
1695
  };
1451
1696
  for (const addon of addons.split("&")) {
1452
1697
  let [key, value] = addon.split("=");
1453
- key = key.replace(/_/, "-");
1698
+ key = key.replace(/_/g, "-");
1454
1699
  value = decodeURIComponent(value);
1455
1700
  if (["alpn"].includes(key)) {
1456
1701
  proxy[key] = value ? value.split(",") : void 0;
1457
1702
  } else if (["allow-insecure"].includes(key)) {
1458
1703
  proxy["skip-cert-verify"] = /(TRUE)|1/i.test(value);
1704
+ } else if (["fast-open"].includes(key)) {
1705
+ proxy.tfo = true;
1459
1706
  } else if (["disable-sni", "reduce-rtt"].includes(key)) {
1460
1707
  proxy[key] = /(TRUE)|1/i.test(value);
1708
+ } else if (key === "congestion-control") {
1709
+ proxy["congestion-controller"] = value;
1710
+ delete proxy[key];
1461
1711
  } else {
1462
1712
  proxy[key] = value;
1463
1713
  }
@@ -1544,6 +1794,11 @@ function URI_Trojan() {
1544
1794
  return /^trojan:\/\//.test(line);
1545
1795
  };
1546
1796
  const parse = (line) => {
1797
+ const matched = /^(trojan:\/\/.*?@.*?)(:(\d+))?\/?(\?.*?)?$/.exec(line);
1798
+ const port = matched?.[2];
1799
+ if (!port) {
1800
+ line = line.replace(matched[1], `${matched[1]}:443`);
1801
+ }
1547
1802
  let [newLine, name2] = line.split(/#(.+)/, 2);
1548
1803
  const parser5 = getParser4();
1549
1804
  const proxy = parser5.parse(newLine);
@@ -1571,6 +1826,9 @@ function Clash_All() {
1571
1826
  const parse = (line) => {
1572
1827
  const proxy = JSON.parse(line);
1573
1828
  if (![
1829
+ "anytls",
1830
+ "mieru",
1831
+ "juicity",
1574
1832
  "ss",
1575
1833
  "ssr",
1576
1834
  "vmess",
@@ -1583,7 +1841,8 @@ function Clash_All() {
1583
1841
  "hysteria",
1584
1842
  "hysteria2",
1585
1843
  "wireguard",
1586
- "ssh"
1844
+ "ssh",
1845
+ "direct"
1587
1846
  ].includes(proxy.type)) {
1588
1847
  throw new Error(
1589
1848
  `Clash does not support proxy with type: ${proxy.type}`
@@ -1835,6 +2094,14 @@ function Loon_WireGuard() {
1835
2094
  };
1836
2095
  return { name, test, parse };
1837
2096
  }
2097
+ function Surge_Direct() {
2098
+ const name = "Surge Direct Parser";
2099
+ const test = (line) => {
2100
+ return /^.*=\s*direct/.test(line.split(",")[0]);
2101
+ };
2102
+ const parse = (line) => getParser().parse(line);
2103
+ return { name, test, parse };
2104
+ }
1838
2105
  function Surge_SSH() {
1839
2106
  const name = "Surge SSH Parser";
1840
2107
  const test = (line) => {
@@ -1989,6 +2256,8 @@ function isIP(ip) {
1989
2256
  return isIPv4(ip) || isIPv6(ip);
1990
2257
  }
1991
2258
  var parsers_default = [
2259
+ URI_PROXY(),
2260
+ URI_SOCKS(),
1992
2261
  URI_SS(),
1993
2262
  URI_SSR(),
1994
2263
  URI_VMess(),
@@ -1998,7 +2267,9 @@ var parsers_default = [
1998
2267
  URI_Hysteria(),
1999
2268
  URI_Hysteria2(),
2000
2269
  URI_Trojan(),
2270
+ URI_AnyTLS(),
2001
2271
  Clash_All(),
2272
+ Surge_Direct(),
2002
2273
  Surge_SSH(),
2003
2274
  Surge_SS(),
2004
2275
  Surge_VMess(),
@@ -2028,7 +2299,7 @@ var parsers_default = [
2028
2299
  QX_Socks5()
2029
2300
  ];
2030
2301
 
2031
- // Sub-Store/backend/src/core/proxy-utils/producers/utils.js
2302
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/utils.js
2032
2303
  import _ from "lodash";
2033
2304
  var Result = class {
2034
2305
  constructor(proxy) {
@@ -2055,19 +2326,7 @@ function isPresent2(obj, attr) {
2055
2326
  return typeof data !== "undefined" && data !== null;
2056
2327
  }
2057
2328
 
2058
- // src/core/app/index.js
2059
- var app_default = new Proxy(console, {
2060
- get: function(target, prop) {
2061
- if (prop in target) {
2062
- return target[prop];
2063
- }
2064
- return function() {
2065
- return void 0;
2066
- };
2067
- }
2068
- });
2069
-
2070
- // Sub-Store/backend/src/core/proxy-utils/producers/surge.js
2329
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/surge.js
2071
2330
  var targetPlatform = "Surge";
2072
2331
  var ipVersions = {
2073
2332
  dual: "dual",
@@ -2091,6 +2350,8 @@ function Surge_Producer() {
2091
2350
  return vmess(proxy, opts["include-unsupported-proxy"]);
2092
2351
  case "http":
2093
2352
  return http(proxy);
2353
+ case "direct":
2354
+ return direct(proxy);
2094
2355
  case "socks5":
2095
2356
  return socks5(proxy);
2096
2357
  case "snell":
@@ -2113,7 +2374,7 @@ function Surge_Producer() {
2113
2374
  };
2114
2375
  return { produce: produce2 };
2115
2376
  }
2116
- function shadowsocks(proxy, includeUnsupportedProxy) {
2377
+ function shadowsocks(proxy) {
2117
2378
  const result = new Result(proxy);
2118
2379
  result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
2119
2380
  if (!proxy.cipher) {
@@ -2146,12 +2407,13 @@ function shadowsocks(proxy, includeUnsupportedProxy) {
2146
2407
  "chacha20",
2147
2408
  "chacha20-ietf",
2148
2409
  "none",
2149
- ...includeUnsupportedProxy ? ["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm"] : []
2410
+ "2022-blake3-aes-128-gcm",
2411
+ "2022-blake3-aes-256-gcm"
2150
2412
  ].includes(proxy.cipher)) {
2151
2413
  throw new Error(`cipher ${proxy.cipher} is not supported`);
2152
2414
  }
2153
2415
  result.append(`,encrypt-method=${proxy.cipher}`);
2154
- result.appendIfPresent(`,password=${proxy.password}`, "password");
2416
+ result.appendIfPresent(`,password="${proxy.password}"`, "password");
2155
2417
  const ip_version = ipVersions[proxy["ip-version"]] || proxy["ip-version"];
2156
2418
  result.appendIfPresent(`,ip-version=${ip_version}`, "ip-version");
2157
2419
  result.appendIfPresent(
@@ -2175,7 +2437,6 @@ function shadowsocks(proxy, includeUnsupportedProxy) {
2175
2437
  }
2176
2438
  result.appendIfPresent(`,tfo=${proxy.tfo}`, "tfo");
2177
2439
  result.appendIfPresent(`,udp-relay=${proxy.udp}`, "udp");
2178
- result.appendIfPresent(`,udp-port=${proxy["udp-port"]}`, "udp-port");
2179
2440
  result.appendIfPresent(`,test-url=${proxy["test-url"]}`, "test-url");
2180
2441
  result.appendIfPresent(
2181
2442
  `,test-timeout=${proxy["test-timeout"]}`,
@@ -2202,6 +2463,7 @@ function shadowsocks(proxy, includeUnsupportedProxy) {
2202
2463
  `,shadow-tls-sni=${proxy["shadow-tls-sni"]}`,
2203
2464
  "shadow-tls-sni"
2204
2465
  );
2466
+ result.appendIfPresent(`,udp-port=${proxy["udp-port"]}`, "udp-port");
2205
2467
  } else if (["shadow-tls"].includes(proxy.plugin) && proxy["plugin-opts"]) {
2206
2468
  const password = proxy["plugin-opts"].password;
2207
2469
  const host = proxy["plugin-opts"].host;
@@ -2219,6 +2481,10 @@ function shadowsocks(proxy, includeUnsupportedProxy) {
2219
2481
  }
2220
2482
  result.append(`,shadow-tls-version=${version}`);
2221
2483
  }
2484
+ result.appendIfPresent(
2485
+ `,udp-port=${proxy["udp-port"]}`,
2486
+ "udp-port"
2487
+ );
2222
2488
  }
2223
2489
  }
2224
2490
  result.appendIfPresent(`,block-quic=${proxy["block-quic"]}`, "block-quic");
@@ -2231,7 +2497,7 @@ function shadowsocks(proxy, includeUnsupportedProxy) {
2231
2497
  function trojan(proxy) {
2232
2498
  const result = new Result(proxy);
2233
2499
  result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
2234
- result.appendIfPresent(`,password=${proxy.password}`, "password");
2500
+ result.appendIfPresent(`,password="${proxy.password}"`, "password");
2235
2501
  const ip_version = ipVersions[proxy["ip-version"]] || proxy["ip-version"];
2236
2502
  result.appendIfPresent(`,ip-version=${ip_version}`, "ip-version");
2237
2503
  result.appendIfPresent(
@@ -2351,7 +2617,7 @@ function ssh(proxy) {
2351
2617
  const result = new Result(proxy);
2352
2618
  result.append(`${proxy.name}=ssh,${proxy.server},${proxy.port}`);
2353
2619
  result.appendIfPresent(`,${proxy.username}`, "username");
2354
- result.appendIfPresent(`,${proxy.password}`, "password");
2620
+ result.appendIfPresent(`,"${proxy.password}"`, "password");
2355
2621
  result.appendIfPresent(
2356
2622
  `,private-key=${proxy["keystore-private-key"]}`,
2357
2623
  "keystore-private-key"
@@ -2396,11 +2662,14 @@ function ssh(proxy) {
2396
2662
  return result.toString();
2397
2663
  }
2398
2664
  function http(proxy) {
2665
+ if (proxy.headers && Object.keys(proxy.headers).length > 0) {
2666
+ throw new Error(`headers is unsupported`);
2667
+ }
2399
2668
  const result = new Result(proxy);
2400
2669
  const type = proxy.tls ? "https" : "http";
2401
2670
  result.append(`${proxy.name}=${type},${proxy.server},${proxy.port}`);
2402
2671
  result.appendIfPresent(`,${proxy.username}`, "username");
2403
- result.appendIfPresent(`,${proxy.password}`, "password");
2672
+ result.appendIfPresent(`,"${proxy.password}"`, "password");
2404
2673
  const ip_version = ipVersions[proxy["ip-version"]] || proxy["ip-version"];
2405
2674
  result.appendIfPresent(`,ip-version=${ip_version}`, "ip-version");
2406
2675
  result.appendIfPresent(
@@ -2452,12 +2721,47 @@ function http(proxy) {
2452
2721
  );
2453
2722
  return result.toString();
2454
2723
  }
2724
+ function direct(proxy) {
2725
+ const result = new Result(proxy);
2726
+ const type = "direct";
2727
+ result.append(`${proxy.name}=${type}`);
2728
+ const ip_version = ipVersions[proxy["ip-version"]] || proxy["ip-version"];
2729
+ result.appendIfPresent(`,ip-version=${ip_version}`, "ip-version");
2730
+ result.appendIfPresent(
2731
+ `,no-error-alert=${proxy["no-error-alert"]}`,
2732
+ "no-error-alert"
2733
+ );
2734
+ result.appendIfPresent(`,tfo=${proxy.tfo}`, "tfo");
2735
+ result.appendIfPresent(`,udp-relay=${proxy.udp}`, "udp");
2736
+ result.appendIfPresent(`,test-url=${proxy["test-url"]}`, "test-url");
2737
+ result.appendIfPresent(
2738
+ `,test-timeout=${proxy["test-timeout"]}`,
2739
+ "test-timeout"
2740
+ );
2741
+ result.appendIfPresent(`,test-udp=${proxy["test-udp"]}`, "test-udp");
2742
+ result.appendIfPresent(`,hybrid=${proxy["hybrid"]}`, "hybrid");
2743
+ result.appendIfPresent(`,tos=${proxy["tos"]}`, "tos");
2744
+ result.appendIfPresent(
2745
+ `,allow-other-interface=${proxy["allow-other-interface"]}`,
2746
+ "allow-other-interface"
2747
+ );
2748
+ result.appendIfPresent(
2749
+ `,interface=${proxy["interface-name"]}`,
2750
+ "interface-name"
2751
+ );
2752
+ result.appendIfPresent(`,block-quic=${proxy["block-quic"]}`, "block-quic");
2753
+ result.appendIfPresent(
2754
+ `,underlying-proxy=${proxy["underlying-proxy"]}`,
2755
+ "underlying-proxy"
2756
+ );
2757
+ return result.toString();
2758
+ }
2455
2759
  function socks5(proxy) {
2456
2760
  const result = new Result(proxy);
2457
2761
  const type = proxy.tls ? "socks5-tls" : "socks5";
2458
2762
  result.append(`${proxy.name}=${type},${proxy.server},${proxy.port}`);
2459
2763
  result.appendIfPresent(`,${proxy.username}`, "username");
2460
- result.appendIfPresent(`,${proxy.password}`, "password");
2764
+ result.appendIfPresent(`,"${proxy.password}"`, "password");
2461
2765
  const ip_version = ipVersions[proxy["ip-version"]] || proxy["ip-version"];
2462
2766
  result.appendIfPresent(`,ip-version=${ip_version}`, "ip-version");
2463
2767
  result.appendIfPresent(
@@ -2579,7 +2883,7 @@ function tuic(proxy) {
2579
2883
  }
2580
2884
  result.append(`${proxy.name}=${type},${proxy.server},${proxy.port}`);
2581
2885
  result.appendIfPresent(`,uuid=${proxy.uuid}`, "uuid");
2582
- result.appendIfPresent(`,password=${proxy.password}`, "password");
2886
+ result.appendIfPresent(`,password="${proxy.password}"`, "password");
2583
2887
  result.appendIfPresent(`,token=${proxy.token}`, "token");
2584
2888
  result.appendIfPresent(
2585
2889
  `,alpn=${Array.isArray(proxy.alpn) ? proxy.alpn[0] : proxy.alpn}`,
@@ -2798,7 +3102,7 @@ function hysteria2(proxy) {
2798
3102
  }
2799
3103
  const result = new Result(proxy);
2800
3104
  result.append(`${proxy.name}=hysteria2,${proxy.server},${proxy.port}`);
2801
- result.appendIfPresent(`,password=${proxy.password}`, "password");
3105
+ result.appendIfPresent(`,password="${proxy.password}"`, "password");
2802
3106
  if (isPresent2(proxy, "ports")) {
2803
3107
  result.append(`,port-hopping="${proxy.ports.replace(/,/g, ";")}"`);
2804
3108
  }
@@ -2900,10 +3204,10 @@ function handleTransport(result, proxy, includeUnsupportedProxy) {
2900
3204
  }
2901
3205
  }
2902
3206
 
2903
- // Sub-Store/backend/src/core/proxy-utils/producers/surgemac.js
3207
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/surgemac.js
2904
3208
  import { Base64 as Base642 } from "js-base64";
2905
3209
 
2906
- // Sub-Store/backend/src/core/proxy-utils/producers/clashmeta.js
3210
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/clashmeta.js
2907
3211
  function ClashMeta_Producer() {
2908
3212
  const type = "ALL";
2909
3213
  const produce2 = (proxies, type2, opts = {}) => {
@@ -2911,6 +3215,45 @@ function ClashMeta_Producer() {
2911
3215
  if (opts["include-unsupported-proxy"]) return true;
2912
3216
  if (proxy.type === "snell" && String(proxy.version) === "4") {
2913
3217
  return false;
3218
+ } else if (["juicity"].includes(proxy.type)) {
3219
+ return false;
3220
+ } else if (["ss"].includes(proxy.type) && ![
3221
+ "aes-128-ctr",
3222
+ "aes-192-ctr",
3223
+ "aes-256-ctr",
3224
+ "aes-128-cfb",
3225
+ "aes-192-cfb",
3226
+ "aes-256-cfb",
3227
+ "aes-128-gcm",
3228
+ "aes-192-gcm",
3229
+ "aes-256-gcm",
3230
+ "aes-128-ccm",
3231
+ "aes-192-ccm",
3232
+ "aes-256-ccm",
3233
+ "aes-128-gcm-siv",
3234
+ "aes-256-gcm-siv",
3235
+ "chacha20-ietf",
3236
+ "chacha20",
3237
+ "xchacha20",
3238
+ "chacha20-ietf-poly1305",
3239
+ "xchacha20-ietf-poly1305",
3240
+ "chacha8-ietf-poly1305",
3241
+ "xchacha8-ietf-poly1305",
3242
+ "2022-blake3-aes-128-gcm",
3243
+ "2022-blake3-aes-256-gcm",
3244
+ "2022-blake3-chacha20-poly1305",
3245
+ "lea-128-gcm",
3246
+ "lea-192-gcm",
3247
+ "lea-256-gcm",
3248
+ "rabbit128-poly1305",
3249
+ "aegis-128l",
3250
+ "aegis-256",
3251
+ "aez-384",
3252
+ "deoxys-ii-256-128",
3253
+ "rc4-md5",
3254
+ "none"
3255
+ ].includes(proxy.cipher)) {
3256
+ return false;
2914
3257
  }
2915
3258
  return true;
2916
3259
  }).map((proxy) => {
@@ -2927,9 +3270,10 @@ function ClashMeta_Producer() {
2927
3270
  }
2928
3271
  if (isPresent2(proxy, "cipher") && ![
2929
3272
  "auto",
3273
+ "none",
3274
+ "zero",
2930
3275
  "aes-128-gcm",
2931
- "chacha20-poly1305",
2932
- "none"
3276
+ "chacha20-poly1305"
2933
3277
  ].includes(proxy.cipher)) {
2934
3278
  proxy.cipher = "auto";
2935
3279
  }
@@ -2960,6 +3304,8 @@ function ClashMeta_Producer() {
2960
3304
  proxy["persistent-keepalive"] = proxy.keepalive;
2961
3305
  proxy["preshared-key"] = proxy["preshared-key"] ?? proxy["pre-shared-key"];
2962
3306
  proxy["pre-shared-key"] = proxy["preshared-key"];
3307
+ } else if (proxy.type === "snell" && proxy.version < 3) {
3308
+ delete proxy.udp;
2963
3309
  } else if (proxy.type === "vless") {
2964
3310
  if (isPresent2(proxy, "sni")) {
2965
3311
  proxy.servername = proxy.sni;
@@ -2973,6 +3319,9 @@ function ClashMeta_Producer() {
2973
3319
  password: proxy["shadow-tls-password"],
2974
3320
  version: proxy["shadow-tls-version"]
2975
3321
  };
3322
+ delete proxy["shadow-tls-password"];
3323
+ delete proxy["shadow-tls-sni"];
3324
+ delete proxy["shadow-tls-version"];
2976
3325
  }
2977
3326
  }
2978
3327
  if (["vmess", "vless"].includes(proxy.type) && proxy.network === "http") {
@@ -3005,7 +3354,8 @@ function ClashMeta_Producer() {
3005
3354
  "tuic",
3006
3355
  "hysteria",
3007
3356
  "hysteria2",
3008
- "juicity"
3357
+ "juicity",
3358
+ "anytls"
3009
3359
  ].includes(proxy.type)) {
3010
3360
  delete proxy.tls;
3011
3361
  }
@@ -3025,7 +3375,7 @@ function ClashMeta_Producer() {
3025
3375
  delete proxy.id;
3026
3376
  delete proxy.resolved;
3027
3377
  delete proxy["no-resolve"];
3028
- if (type2 !== "internal") {
3378
+ if (type2 !== "internal" || opts["delete-underscore-fields"]) {
3029
3379
  for (const key in proxy) {
3030
3380
  if (proxy[key] == null || /^_/i.test(key)) {
3031
3381
  delete proxy[key];
@@ -3034,6 +3384,7 @@ function ClashMeta_Producer() {
3034
3384
  }
3035
3385
  if (["grpc"].includes(proxy.network) && proxy[`${proxy.network}-opts`]) {
3036
3386
  delete proxy[`${proxy.network}-opts`]["_grpc-type"];
3387
+ delete proxy[`${proxy.network}-opts`]["_grpc-authority"];
3037
3388
  }
3038
3389
  return proxy;
3039
3390
  });
@@ -3042,7 +3393,7 @@ function ClashMeta_Producer() {
3042
3393
  return { type, produce: produce2 };
3043
3394
  }
3044
3395
 
3045
- // Sub-Store/backend/src/core/proxy-utils/producers/surgemac.js
3396
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/surgemac.js
3046
3397
  var targetPlatform2 = "SurgeMac";
3047
3398
  var surge_Producer = Surge_Producer();
3048
3399
  function SurgeMac_Producer() {
@@ -3123,9 +3474,16 @@ function mihomo(proxy, type, opts) {
3123
3474
  dns: {
3124
3475
  enable: true,
3125
3476
  ipv6,
3126
- nameserver: [
3127
- "https://223.6.6.6/dns-query",
3128
- "https://120.53.53.53/dns-query"
3477
+ "default-nameserver": opts?.defaultNameserver || proxy._defaultNameserver || [
3478
+ "180.76.76.76",
3479
+ "52.80.52.52",
3480
+ "119.28.28.28",
3481
+ "223.6.6.6"
3482
+ ],
3483
+ nameserver: opts?.nameserver || proxy._nameserver || [
3484
+ "https://doh.pub/dns-query",
3485
+ "https://dns.alidns.com/dns-query",
3486
+ "https://doh-pure.onedns.net/dns-query"
3129
3487
  ]
3130
3488
  },
3131
3489
  proxies: [
@@ -3161,7 +3519,7 @@ function isIP2(ip) {
3161
3519
  return isIPv4(ip) || isIPv6(ip);
3162
3520
  }
3163
3521
 
3164
- // Sub-Store/backend/src/core/proxy-utils/producers/clash.js
3522
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/clash.js
3165
3523
  function Clash_Producer() {
3166
3524
  const type = "ALL";
3167
3525
  const produce2 = (proxies, type2, opts = {}) => {
@@ -3194,6 +3552,11 @@ function Clash_Producer() {
3194
3552
  "xchacha20-ietf-poly1305"
3195
3553
  ].includes(proxy.cipher) || proxy.type === "snell" && String(proxy.version) === "4" || proxy.type === "vless" && (typeof proxy.flow !== "undefined" || proxy["reality-opts"])) {
3196
3554
  return false;
3555
+ } else if (proxy["underlying-proxy"] || proxy["dialer-proxy"]) {
3556
+ app_default.error(
3557
+ `Clash \u4E0D\u652F\u6301\u524D\u7F6E\u4EE3\u7406\u5B57\u6BB5. \u5DF2\u8FC7\u6EE4\u8282\u70B9 ${proxy.name}`
3558
+ );
3559
+ return false;
3197
3560
  }
3198
3561
  return true;
3199
3562
  }).map((proxy) => {
@@ -3221,6 +3584,8 @@ function Clash_Producer() {
3221
3584
  proxy["persistent-keepalive"] = proxy.keepalive;
3222
3585
  proxy["preshared-key"] = proxy["preshared-key"] ?? proxy["pre-shared-key"];
3223
3586
  proxy["pre-shared-key"] = proxy["preshared-key"];
3587
+ } else if (proxy.type === "snell" && proxy.version < 3) {
3588
+ delete proxy.udp;
3224
3589
  } else if (proxy.type === "vless") {
3225
3590
  if (isPresent2(proxy, "sni")) {
3226
3591
  proxy.servername = proxy.sni;
@@ -3257,7 +3622,8 @@ function Clash_Producer() {
3257
3622
  "tuic",
3258
3623
  "hysteria",
3259
3624
  "hysteria2",
3260
- "juicity"
3625
+ "juicity",
3626
+ "anytls"
3261
3627
  ].includes(proxy.type)) {
3262
3628
  delete proxy.tls;
3263
3629
  }
@@ -3265,10 +3631,6 @@ function Clash_Producer() {
3265
3631
  proxy.fingerprint = proxy["tls-fingerprint"];
3266
3632
  }
3267
3633
  delete proxy["tls-fingerprint"];
3268
- if (proxy["underlying-proxy"]) {
3269
- proxy["dialer-proxy"] = proxy["underlying-proxy"];
3270
- }
3271
- delete proxy["underlying-proxy"];
3272
3634
  if (isPresent2(proxy, "tls") && typeof proxy.tls !== "boolean") {
3273
3635
  delete proxy.tls;
3274
3636
  }
@@ -3286,6 +3648,7 @@ function Clash_Producer() {
3286
3648
  }
3287
3649
  if (["grpc"].includes(proxy.network) && proxy[`${proxy.network}-opts`]) {
3288
3650
  delete proxy[`${proxy.network}-opts`]["_grpc-type"];
3651
+ delete proxy[`${proxy.network}-opts`]["_grpc-authority"];
3289
3652
  }
3290
3653
  return proxy;
3291
3654
  });
@@ -3294,12 +3657,11 @@ function Clash_Producer() {
3294
3657
  return { type, produce: produce2 };
3295
3658
  }
3296
3659
 
3297
- // Sub-Store/backend/src/core/proxy-utils/producers/stash.js
3660
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/stash.js
3298
3661
  function Stash_Producer() {
3299
3662
  const type = "ALL";
3300
3663
  const produce2 = (proxies, type2, opts = {}) => {
3301
3664
  const list = proxies.filter((proxy) => {
3302
- if (opts["include-unsupported-proxy"]) return true;
3303
3665
  if (![
3304
3666
  "ss",
3305
3667
  "ssr",
@@ -3329,8 +3691,15 @@ function Stash_Producer() {
3329
3691
  "chacha20-ietf",
3330
3692
  "xchacha20",
3331
3693
  "chacha20-ietf-poly1305",
3332
- "xchacha20-ietf-poly1305"
3333
- ].includes(proxy.cipher) || proxy.type === "snell" && String(proxy.version) === "4" || proxy.type === "vless" && proxy["reality-opts"]) {
3694
+ "xchacha20-ietf-poly1305",
3695
+ "2022-blake3-aes-128-gcm",
3696
+ "2022-blake3-aes-256-gcm"
3697
+ ].includes(proxy.cipher) || proxy.type === "snell" && String(proxy.version) === "4" || (opts["include-unsupported-proxy"] ? proxy.type === "vless" && proxy["reality-opts"] && !["xtls-rprx-vision"].includes(proxy.flow) : proxy.type === "vless" && proxy["reality-opts"])) {
3698
+ return false;
3699
+ } else if (proxy["underlying-proxy"] || proxy["dialer-proxy"]) {
3700
+ app_default.error(
3701
+ `Stash \u6682\u4E0D\u652F\u6301\u524D\u7F6E\u4EE3\u7406\u5B57\u6BB5. \u5DF2\u8FC7\u6EE4\u8282\u70B9 ${proxy.name}. \u8BF7\u4F7F\u7528 \u4EE3\u7406\u7684\u8F6C\u53D1\u94FE https://stash.wiki/proxy-protocols/proxy-groups#relay`
3702
+ );
3334
3703
  return false;
3335
3704
  }
3336
3705
  return true;
@@ -3420,6 +3789,8 @@ function Stash_Producer() {
3420
3789
  proxy["persistent-keepalive"] = proxy.keepalive;
3421
3790
  proxy["preshared-key"] = proxy["preshared-key"] ?? proxy["pre-shared-key"];
3422
3791
  proxy["pre-shared-key"] = proxy["preshared-key"];
3792
+ } else if (proxy.type === "snell" && proxy.version < 3) {
3793
+ delete proxy.udp;
3423
3794
  } else if (proxy.type === "vless") {
3424
3795
  if (isPresent2(proxy, "sni")) {
3425
3796
  proxy.servername = proxy.sni;
@@ -3456,7 +3827,8 @@ function Stash_Producer() {
3456
3827
  "tuic",
3457
3828
  "hysteria",
3458
3829
  "hysteria2",
3459
- "juicity"
3830
+ "juicity",
3831
+ "anytls"
3460
3832
  ].includes(proxy.type)) {
3461
3833
  delete proxy.tls;
3462
3834
  }
@@ -3464,10 +3836,6 @@ function Stash_Producer() {
3464
3836
  proxy["server-cert-fingerprint"] = proxy["tls-fingerprint"];
3465
3837
  }
3466
3838
  delete proxy["tls-fingerprint"];
3467
- if (proxy["underlying-proxy"]) {
3468
- proxy["dialer-proxy"] = proxy["underlying-proxy"];
3469
- }
3470
- delete proxy["underlying-proxy"];
3471
3839
  if (isPresent2(proxy, "tls") && typeof proxy.tls !== "boolean") {
3472
3840
  delete proxy.tls;
3473
3841
  }
@@ -3493,6 +3861,7 @@ function Stash_Producer() {
3493
3861
  }
3494
3862
  if (["grpc"].includes(proxy.network) && proxy[`${proxy.network}-opts`]) {
3495
3863
  delete proxy[`${proxy.network}-opts`]["_grpc-type"];
3864
+ delete proxy[`${proxy.network}-opts`]["_grpc-authority"];
3496
3865
  }
3497
3866
  return proxy;
3498
3867
  });
@@ -3501,10 +3870,17 @@ function Stash_Producer() {
3501
3870
  return { type, produce: produce2 };
3502
3871
  }
3503
3872
 
3504
- // Sub-Store/backend/src/core/proxy-utils/producers/loon.js
3873
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/loon.js
3505
3874
  var targetPlatform3 = "Loon";
3875
+ var ipVersions2 = {
3876
+ dual: "dual",
3877
+ ipv4: "v4-only",
3878
+ ipv6: "v6-only",
3879
+ "ipv4-prefer": "prefer-v4",
3880
+ "ipv6-prefer": "prefer-v6"
3881
+ };
3506
3882
  function Loon_Producer() {
3507
- const produce2 = (proxy) => {
3883
+ const produce2 = (proxy, type, opts = {}) => {
3508
3884
  switch (proxy.type) {
3509
3885
  case "ss":
3510
3886
  return shadowsocks2(proxy);
@@ -3513,9 +3889,9 @@ function Loon_Producer() {
3513
3889
  case "trojan":
3514
3890
  return trojan2(proxy);
3515
3891
  case "vmess":
3516
- return vmess2(proxy);
3892
+ return vmess2(proxy, opts["include-unsupported-proxy"]);
3517
3893
  case "vless":
3518
- return vless(proxy);
3894
+ return vless(proxy, opts["include-unsupported-proxy"]);
3519
3895
  case "http":
3520
3896
  return http2(proxy);
3521
3897
  case "socks5":
@@ -3553,7 +3929,9 @@ function shadowsocks2(proxy) {
3553
3929
  "aes-192-gcm",
3554
3930
  "aes-256-gcm",
3555
3931
  "chacha20-ietf-poly1305",
3556
- "xchacha20-ietf-poly1305"
3932
+ "xchacha20-ietf-poly1305",
3933
+ "2022-blake3-aes-128-gcm",
3934
+ "2022-blake3-aes-256-gcm"
3557
3935
  ].includes(proxy.cipher)) {
3558
3936
  throw new Error(`cipher ${proxy.cipher} is not supported`);
3559
3937
  }
@@ -3571,32 +3949,114 @@ function shadowsocks2(proxy) {
3571
3949
  `,obfs-uri=${proxy["plugin-opts"].path}`,
3572
3950
  "plugin-opts.path"
3573
3951
  );
3574
- } else {
3952
+ } else if (!["shadow-tls"].includes(proxy.plugin)) {
3575
3953
  throw new Error(`plugin ${proxy.plugin} is not supported`);
3576
3954
  }
3577
3955
  }
3578
- result.appendIfPresent(`,fast-open=${proxy.tfo}`, "tfo");
3579
- if (proxy.udp) {
3580
- result.append(`,udp=true`);
3581
- }
3582
- return result.toString();
3583
- }
3584
- function shadowsocksr(proxy) {
3585
- const result = new Result(proxy);
3586
- result.append(
3587
- `${proxy.name}=shadowsocksr,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"`
3588
- );
3589
- result.append(`,protocol=${proxy.protocol}`);
3590
- result.appendIfPresent(
3591
- `,protocol-param=${proxy["protocol-param"]}`,
3592
- "protocol-param"
3593
- );
3956
+ if (isPresent2(proxy, "shadow-tls-password")) {
3957
+ result.append(`,shadow-tls-password=${proxy["shadow-tls-password"]}`);
3958
+ result.appendIfPresent(
3959
+ `,shadow-tls-version=${proxy["shadow-tls-version"]}`,
3960
+ "shadow-tls-version"
3961
+ );
3962
+ result.appendIfPresent(
3963
+ `,shadow-tls-sni=${proxy["shadow-tls-sni"]}`,
3964
+ "shadow-tls-sni"
3965
+ );
3966
+ result.appendIfPresent(`,udp-port=${proxy["udp-port"]}`, "udp-port");
3967
+ } else if (["shadow-tls"].includes(proxy.plugin) && proxy["plugin-opts"]) {
3968
+ const password = proxy["plugin-opts"].password;
3969
+ const host = proxy["plugin-opts"].host;
3970
+ const version = proxy["plugin-opts"].version;
3971
+ if (password) {
3972
+ result.append(`,shadow-tls-password=${password}`);
3973
+ if (host) {
3974
+ result.append(`,shadow-tls-sni=${host}`);
3975
+ }
3976
+ if (version) {
3977
+ if (version < 2) {
3978
+ throw new Error(
3979
+ `shadow-tls version ${version} is not supported`
3980
+ );
3981
+ }
3982
+ result.append(`,shadow-tls-version=${version}`);
3983
+ }
3984
+ result.appendIfPresent(
3985
+ `,udp-port=${proxy["udp-port"]}`,
3986
+ "udp-port"
3987
+ );
3988
+ }
3989
+ }
3990
+ result.appendIfPresent(`,fast-open=${proxy.tfo}`, "tfo");
3991
+ if (proxy["block-quic"] === "on") {
3992
+ result.append(",block-quic=true");
3993
+ } else if (proxy["block-quic"] === "off") {
3994
+ result.append(",block-quic=false");
3995
+ }
3996
+ if (proxy.udp) {
3997
+ result.append(`,udp=true`);
3998
+ }
3999
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4000
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
4001
+ return result.toString();
4002
+ }
4003
+ function shadowsocksr(proxy) {
4004
+ const result = new Result(proxy);
4005
+ result.append(
4006
+ `${proxy.name}=shadowsocksr,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"`
4007
+ );
4008
+ result.append(`,protocol=${proxy.protocol}`);
4009
+ result.appendIfPresent(
4010
+ `,protocol-param=${proxy["protocol-param"]}`,
4011
+ "protocol-param"
4012
+ );
3594
4013
  result.appendIfPresent(`,obfs=${proxy.obfs}`, "obfs");
3595
4014
  result.appendIfPresent(`,obfs-param=${proxy["obfs-param"]}`, "obfs-param");
4015
+ if (isPresent2(proxy, "shadow-tls-password")) {
4016
+ result.append(`,shadow-tls-password=${proxy["shadow-tls-password"]}`);
4017
+ result.appendIfPresent(
4018
+ `,shadow-tls-version=${proxy["shadow-tls-version"]}`,
4019
+ "shadow-tls-version"
4020
+ );
4021
+ result.appendIfPresent(
4022
+ `,shadow-tls-sni=${proxy["shadow-tls-sni"]}`,
4023
+ "shadow-tls-sni"
4024
+ );
4025
+ result.appendIfPresent(`,udp-port=${proxy["udp-port"]}`, "udp-port");
4026
+ } else if (["shadow-tls"].includes(proxy.plugin) && proxy["plugin-opts"]) {
4027
+ const password = proxy["plugin-opts"].password;
4028
+ const host = proxy["plugin-opts"].host;
4029
+ const version = proxy["plugin-opts"].version;
4030
+ if (password) {
4031
+ result.append(`,shadow-tls-password=${password}`);
4032
+ if (host) {
4033
+ result.append(`,shadow-tls-sni=${host}`);
4034
+ }
4035
+ if (version) {
4036
+ if (version < 2) {
4037
+ throw new Error(
4038
+ `shadow-tls version ${version} is not supported`
4039
+ );
4040
+ }
4041
+ result.append(`,shadow-tls-version=${version}`);
4042
+ }
4043
+ result.appendIfPresent(
4044
+ `,udp-port=${proxy["udp-port"]}`,
4045
+ "udp-port"
4046
+ );
4047
+ }
4048
+ }
3596
4049
  result.appendIfPresent(`,fast-open=${proxy.tfo}`, "tfo");
4050
+ if (proxy["block-quic"] === "on") {
4051
+ result.append(",block-quic=true");
4052
+ } else if (proxy["block-quic"] === "off") {
4053
+ result.append(",block-quic=false");
4054
+ }
3597
4055
  if (proxy.udp) {
3598
4056
  result.append(`,udp=true`);
3599
4057
  }
4058
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4059
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
3600
4060
  return result.toString();
3601
4061
  }
3602
4062
  function trojan2(proxy) {
@@ -3636,12 +4096,20 @@ function trojan2(proxy) {
3636
4096
  "tls-pubkey-sha256"
3637
4097
  );
3638
4098
  result.appendIfPresent(`,fast-open=${proxy.tfo}`, "tfo");
4099
+ if (proxy["block-quic"] === "on") {
4100
+ result.append(",block-quic=true");
4101
+ } else if (proxy["block-quic"] === "off") {
4102
+ result.append(",block-quic=false");
4103
+ }
3639
4104
  if (proxy.udp) {
3640
4105
  result.append(`,udp=true`);
3641
4106
  }
4107
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4108
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
3642
4109
  return result.toString();
3643
4110
  }
3644
4111
  function vmess2(proxy) {
4112
+ const isReality = !!proxy["reality-opts"];
3645
4113
  const result = new Result(proxy);
3646
4114
  result.append(
3647
4115
  `${proxy.name}=vmess,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.uuid}"`
@@ -3683,29 +4151,54 @@ function vmess2(proxy) {
3683
4151
  `,skip-cert-verify=${proxy["skip-cert-verify"]}`,
3684
4152
  "skip-cert-verify"
3685
4153
  );
3686
- result.appendIfPresent(`,tls-name=${proxy.sni}`, "sni");
3687
- result.appendIfPresent(
3688
- `,tls-cert-sha256=${proxy["tls-fingerprint"]}`,
3689
- "tls-fingerprint"
3690
- );
3691
- result.appendIfPresent(
3692
- `,tls-pubkey-sha256=${proxy["tls-pubkey-sha256"]}`,
3693
- "tls-pubkey-sha256"
3694
- );
4154
+ if (isReality) {
4155
+ result.appendIfPresent(`,sni=${proxy.sni}`, "sni");
4156
+ result.appendIfPresent(
4157
+ `,public-key="${proxy["reality-opts"]["public-key"]}"`,
4158
+ "reality-opts.public-key"
4159
+ );
4160
+ result.appendIfPresent(
4161
+ `,short-id=${proxy["reality-opts"]["short-id"]}`,
4162
+ "reality-opts.short-id"
4163
+ );
4164
+ } else {
4165
+ result.appendIfPresent(`,tls-name=${proxy.sni}`, "sni");
4166
+ result.appendIfPresent(
4167
+ `,tls-cert-sha256=${proxy["tls-fingerprint"]}`,
4168
+ "tls-fingerprint"
4169
+ );
4170
+ result.appendIfPresent(
4171
+ `,tls-pubkey-sha256=${proxy["tls-pubkey-sha256"]}`,
4172
+ "tls-pubkey-sha256"
4173
+ );
4174
+ }
3695
4175
  if (isPresent2(proxy, "aead")) {
3696
4176
  result.append(`,alterId=0`);
3697
4177
  } else {
3698
4178
  result.append(`,alterId=${proxy.alterId}`);
3699
4179
  }
3700
4180
  result.appendIfPresent(`,fast-open=${proxy.tfo}`, "tfo");
4181
+ if (proxy["block-quic"] === "on") {
4182
+ result.append(",block-quic=true");
4183
+ } else if (proxy["block-quic"] === "off") {
4184
+ result.append(",block-quic=false");
4185
+ }
3701
4186
  if (proxy.udp) {
3702
4187
  result.append(`,udp=true`);
3703
4188
  }
4189
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4190
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
3704
4191
  return result.toString();
3705
4192
  }
3706
4193
  function vless(proxy) {
3707
- if (proxy["reality-opts"]) {
3708
- throw new Error(`VLESS REALITY is unsupported`);
4194
+ let isXtls = false;
4195
+ const isReality = !!proxy["reality-opts"];
4196
+ if (typeof proxy.flow !== "undefined") {
4197
+ if (["xtls-rprx-vision"].includes(proxy.flow)) {
4198
+ isXtls = true;
4199
+ } else {
4200
+ throw new Error(`VLESS flow(${proxy.flow}) is not supported`);
4201
+ }
3709
4202
  }
3710
4203
  const result = new Result(proxy);
3711
4204
  result.append(
@@ -3748,19 +4241,41 @@ function vless(proxy) {
3748
4241
  `,skip-cert-verify=${proxy["skip-cert-verify"]}`,
3749
4242
  "skip-cert-verify"
3750
4243
  );
3751
- result.appendIfPresent(`,tls-name=${proxy.sni}`, "sni");
3752
- result.appendIfPresent(
3753
- `,tls-cert-sha256=${proxy["tls-fingerprint"]}`,
3754
- "tls-fingerprint"
3755
- );
3756
- result.appendIfPresent(
3757
- `,tls-pubkey-sha256=${proxy["tls-pubkey-sha256"]}`,
3758
- "tls-pubkey-sha256"
3759
- );
4244
+ if (isXtls) {
4245
+ result.appendIfPresent(`,flow=${proxy.flow}`, "flow");
4246
+ }
4247
+ if (isReality) {
4248
+ result.appendIfPresent(`,sni=${proxy.sni}`, "sni");
4249
+ result.appendIfPresent(
4250
+ `,public-key="${proxy["reality-opts"]["public-key"]}"`,
4251
+ "reality-opts.public-key"
4252
+ );
4253
+ result.appendIfPresent(
4254
+ `,short-id=${proxy["reality-opts"]["short-id"]}`,
4255
+ "reality-opts.short-id"
4256
+ );
4257
+ } else {
4258
+ result.appendIfPresent(`,tls-name=${proxy.sni}`, "sni");
4259
+ result.appendIfPresent(
4260
+ `,tls-cert-sha256=${proxy["tls-fingerprint"]}`,
4261
+ "tls-fingerprint"
4262
+ );
4263
+ result.appendIfPresent(
4264
+ `,tls-pubkey-sha256=${proxy["tls-pubkey-sha256"]}`,
4265
+ "tls-pubkey-sha256"
4266
+ );
4267
+ }
3760
4268
  result.appendIfPresent(`,fast-open=${proxy.tfo}`, "tfo");
4269
+ if (proxy["block-quic"] === "on") {
4270
+ result.append(",block-quic=true");
4271
+ } else if (proxy["block-quic"] === "off") {
4272
+ result.append(",block-quic=false");
4273
+ }
3761
4274
  if (proxy.udp) {
3762
4275
  result.append(`,udp=true`);
3763
4276
  }
4277
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4278
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
3764
4279
  return result.toString();
3765
4280
  }
3766
4281
  function http2(proxy) {
@@ -3775,6 +4290,13 @@ function http2(proxy) {
3775
4290
  "skip-cert-verify"
3776
4291
  );
3777
4292
  result.appendIfPresent(`,tfo=${proxy.tfo}`, "tfo");
4293
+ if (proxy["block-quic"] === "on") {
4294
+ result.append(",block-quic=true");
4295
+ } else if (proxy["block-quic"] === "off") {
4296
+ result.append(",block-quic=false");
4297
+ }
4298
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4299
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
3778
4300
  return result.toString();
3779
4301
  }
3780
4302
  function socks52(proxy) {
@@ -3789,9 +4311,16 @@ function socks52(proxy) {
3789
4311
  "skip-cert-verify"
3790
4312
  );
3791
4313
  result.appendIfPresent(`,tfo=${proxy.tfo}`, "tfo");
4314
+ if (proxy["block-quic"] === "on") {
4315
+ result.append(",block-quic=true");
4316
+ } else if (proxy["block-quic"] === "off") {
4317
+ result.append(",block-quic=false");
4318
+ }
3792
4319
  if (proxy.udp) {
3793
4320
  result.append(`,udp=true`);
3794
4321
  }
4322
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4323
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
3795
4324
  return result.toString();
3796
4325
  }
3797
4326
  function wireguard2(proxy) {
@@ -3843,6 +4372,13 @@ function wireguard2(proxy) {
3843
4372
  result.append(
3844
4373
  `,peers=[{public-key="${proxy["public-key"]}",allowed-ips="${allowedIps ?? "0.0.0.0/0,::/0"}",endpoint=${proxy.server}:${proxy.port}${reserved ?? ""}${presharedKey ?? ""}}]`
3845
4374
  );
4375
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4376
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
4377
+ if (proxy["block-quic"] === "on") {
4378
+ result.append(",block-quic=true");
4379
+ } else if (proxy["block-quic"] === "off") {
4380
+ result.append(",block-quic=false");
4381
+ }
3846
4382
  return result.toString();
3847
4383
  }
3848
4384
  function hysteria22(proxy) {
@@ -3869,6 +4405,11 @@ function hysteria22(proxy) {
3869
4405
  result.append(`,salamander-password=${proxy["obfs-password"]}`);
3870
4406
  }
3871
4407
  result.appendIfPresent(`,fast-open=${proxy.tfo}`, "tfo");
4408
+ if (proxy["block-quic"] === "on") {
4409
+ result.append(",block-quic=true");
4410
+ } else if (proxy["block-quic"] === "off") {
4411
+ result.append(",block-quic=false");
4412
+ }
3872
4413
  if (proxy.udp) {
3873
4414
  result.append(`,udp=true`);
3874
4415
  }
@@ -3877,10 +4418,12 @@ function hysteria22(proxy) {
3877
4418
  "down"
3878
4419
  );
3879
4420
  result.appendIfPresent(`,ecn=${proxy.ecn}`, "ecn");
4421
+ const ip_version = ipVersions2[proxy["ip-version"]] || proxy["ip-version"];
4422
+ result.appendIfPresent(`,ip-mode=${ip_version}`, "ip-version");
3880
4423
  return result.toString();
3881
4424
  }
3882
4425
 
3883
- // Sub-Store/backend/src/core/proxy-utils/producers/uri.js
4426
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/uri.js
3884
4427
  import { Base64 as Base643 } from "js-base64";
3885
4428
  function URI_Producer() {
3886
4429
  const type = "SINGLE";
@@ -3892,7 +4435,7 @@ function URI_Producer() {
3892
4435
  delete proxy.resolved;
3893
4436
  delete proxy["no-resolve"];
3894
4437
  for (const key in proxy) {
3895
- if (proxy[key] == null || /^_/i.test(key)) {
4438
+ if (proxy[key] == null) {
3896
4439
  delete proxy[key];
3897
4440
  }
3898
4441
  }
@@ -3901,13 +4444,20 @@ function URI_Producer() {
3901
4444
  )) {
3902
4445
  delete proxy.tls;
3903
4446
  }
3904
- if (proxy.server && isIPv6(proxy.server)) {
4447
+ if (!["vmess"].includes(proxy.type) && proxy.server && isIPv6(proxy.server)) {
3905
4448
  proxy.server = `[${proxy.server}]`;
3906
4449
  }
3907
4450
  switch (proxy.type) {
4451
+ case "socks5":
4452
+ result = `socks://${encodeURIComponent(
4453
+ Base643.encode(`${proxy.username}:${proxy.password}`)
4454
+ )}@${proxy.server}:${proxy.port}#${proxy.name}`;
4455
+ break;
3908
4456
  case "ss":
3909
4457
  const userinfo = `${proxy.cipher}:${proxy.password}`;
3910
- result = `ss://${Base643.encode(userinfo)}@${proxy.server}:${proxy.port}${proxy.plugin ? "/" : ""}`;
4458
+ result = `ss://${proxy.cipher?.startsWith("2022-blake3-") ? `${encodeURIComponent(
4459
+ proxy.cipher
4460
+ )}:${encodeURIComponent(proxy.password)}` : Base643.encode(userinfo)}@${proxy.server}:${proxy.port}${proxy.plugin ? "/" : ""}`;
3911
4461
  if (proxy.plugin) {
3912
4462
  result += "?plugin=";
3913
4463
  const opts = proxy["plugin-opts"];
@@ -3922,6 +4472,11 @@ function URI_Producer() {
3922
4472
  `v2ray-plugin;obfs=${opts.mode}${opts.host ? ";obfs-host" + opts.host : ""}${opts.tls ? ";tls" : ""}`
3923
4473
  );
3924
4474
  break;
4475
+ case "shadow-tls":
4476
+ result += encodeURIComponent(
4477
+ `shadow-tls;host=${opts.host};password=${opts.password};version=${opts.version}`
4478
+ );
4479
+ break;
3925
4480
  default:
3926
4481
  throw new Error(
3927
4482
  `Unsupported plugin option: ${proxy.plugin}`
@@ -3957,7 +4512,7 @@ function URI_Producer() {
3957
4512
  port: proxy.port,
3958
4513
  id: proxy.uuid,
3959
4514
  type: type2,
3960
- aid: 0,
4515
+ aid: proxy.alterId || 0,
3961
4516
  net,
3962
4517
  tls: proxy.tls ? "tls" : ""
3963
4518
  };
@@ -3976,6 +4531,7 @@ function URI_Producer() {
3976
4531
  if (["grpc"].includes(proxy.network)) {
3977
4532
  result.path = proxy[`${proxy.network}-opts`]?.["grpc-service-name"];
3978
4533
  result.type = proxy[`${proxy.network}-opts`]?.["_grpc-type"] || "gun";
4534
+ result.host = proxy[`${proxy.network}-opts`]?.["_grpc-authority"];
3979
4535
  }
3980
4536
  }
3981
4537
  result = "vmess://" + Base643.encode(JSON.stringify(result));
@@ -3985,6 +4541,7 @@ function URI_Producer() {
3985
4541
  const isReality = proxy["reality-opts"];
3986
4542
  let sid = "";
3987
4543
  let pbk = "";
4544
+ let spx = "";
3988
4545
  if (isReality) {
3989
4546
  security = "reality";
3990
4547
  const publicKey = proxy["reality-opts"]?.["public-key"];
@@ -3995,6 +4552,10 @@ function URI_Producer() {
3995
4552
  if (shortId) {
3996
4553
  sid = `&sid=${encodeURIComponent(shortId)}`;
3997
4554
  }
4555
+ const spiderX = proxy["reality-opts"]?.["_spider-x"];
4556
+ if (spiderX) {
4557
+ spx = `&spx=${encodeURIComponent(spiderX)}`;
4558
+ }
3998
4559
  } else if (proxy.tls) {
3999
4560
  security = "tls";
4000
4561
  }
@@ -4022,6 +4583,14 @@ function URI_Producer() {
4022
4583
  if (proxy.flow) {
4023
4584
  flow = `&flow=${encodeURIComponent(proxy.flow)}`;
4024
4585
  }
4586
+ let extra = "";
4587
+ if (proxy._extra) {
4588
+ extra = `&extra=${encodeURIComponent(proxy._extra)}`;
4589
+ }
4590
+ let mode = "";
4591
+ if (proxy._mode) {
4592
+ mode = `&mode=${encodeURIComponent(proxy._mode)}`;
4593
+ }
4025
4594
  let vlessType = proxy.network;
4026
4595
  if (proxy.network === "ws" && proxy["ws-opts"]?.["v2ray-http-upgrade"]) {
4027
4596
  vlessType = "httpupgrade";
@@ -4031,6 +4600,12 @@ function URI_Producer() {
4031
4600
  vlessTransport += `&mode=${encodeURIComponent(
4032
4601
  proxy[`${proxy.network}-opts`]?.["_grpc-type"] || "gun"
4033
4602
  )}`;
4603
+ const authority = proxy[`${proxy.network}-opts`]?.["_grpc-authority"];
4604
+ if (authority) {
4605
+ vlessTransport += `&authority=${encodeURIComponent(
4606
+ authority
4607
+ )}`;
4608
+ }
4034
4609
  }
4035
4610
  let vlessTransportServiceName = proxy[`${proxy.network}-opts`]?.[`${proxy.network}-service-name`];
4036
4611
  let vlessTransportPath = proxy[`${proxy.network}-opts`]?.path;
@@ -4064,7 +4639,7 @@ function URI_Producer() {
4064
4639
  }
4065
4640
  result = `vless://${proxy.uuid}@${proxy.server}:${proxy.port}?security=${encodeURIComponent(
4066
4641
  security
4067
- )}${vlessTransport}${alpn}${allowInsecure}${sni}${fp}${flow}${sid}${pbk}#${encodeURIComponent(
4642
+ )}${vlessTransport}${alpn}${allowInsecure}${sni}${fp}${flow}${sid}${spx}${pbk}${mode}${extra}#${encodeURIComponent(
4068
4643
  proxy.name
4069
4644
  )}`;
4070
4645
  break;
@@ -4078,11 +4653,17 @@ function URI_Producer() {
4078
4653
  trojanTransport = `&type=${encodeURIComponent(trojanType)}`;
4079
4654
  if (["grpc"].includes(proxy.network)) {
4080
4655
  let trojanTransportServiceName = proxy[`${proxy.network}-opts`]?.[`${proxy.network}-service-name`];
4656
+ let trojanTransportAuthority = proxy[`${proxy.network}-opts`]?.["_grpc-authority"];
4081
4657
  if (trojanTransportServiceName) {
4082
4658
  trojanTransport += `&serviceName=${encodeURIComponent(
4083
4659
  trojanTransportServiceName
4084
4660
  )}`;
4085
4661
  }
4662
+ if (trojanTransportAuthority) {
4663
+ trojanTransport += `&authority=${encodeURIComponent(
4664
+ trojanTransportAuthority
4665
+ )}`;
4666
+ }
4086
4667
  trojanTransport += `&mode=${encodeURIComponent(
4087
4668
  proxy[`${proxy.network}-opts`]?.["_grpc-type"] || "gun"
4088
4669
  )}`;
@@ -4100,10 +4681,62 @@ function URI_Producer() {
4100
4681
  )}`;
4101
4682
  }
4102
4683
  }
4103
- result = `trojan://${proxy.password}@${proxy.server}:${proxy.port}?sni=${encodeURIComponent(proxy.sni || proxy.server)}${proxy["skip-cert-verify"] ? "&allowInsecure=1" : ""}${trojanTransport}#${encodeURIComponent(proxy.name)}`;
4684
+ let trojanFp = "";
4685
+ if (proxy["client-fingerprint"]) {
4686
+ trojanFp = `&fp=${encodeURIComponent(
4687
+ proxy["client-fingerprint"]
4688
+ )}`;
4689
+ }
4690
+ let trojanAlpn = "";
4691
+ if (proxy.alpn) {
4692
+ trojanAlpn = `&alpn=${encodeURIComponent(
4693
+ Array.isArray(proxy.alpn) ? proxy.alpn : proxy.alpn.join(",")
4694
+ )}`;
4695
+ }
4696
+ const trojanIsReality = proxy["reality-opts"];
4697
+ let trojanSid = "";
4698
+ let trojanPbk = "";
4699
+ let trojanSpx = "";
4700
+ let trojanSecurity = "";
4701
+ let trojanMode = "";
4702
+ let trojanExtra = "";
4703
+ if (trojanIsReality) {
4704
+ trojanSecurity = `&security=reality`;
4705
+ const publicKey = proxy["reality-opts"]?.["public-key"];
4706
+ if (publicKey) {
4707
+ trojanPbk = `&pbk=${encodeURIComponent(publicKey)}`;
4708
+ }
4709
+ const shortId = proxy["reality-opts"]?.["short-id"];
4710
+ if (shortId) {
4711
+ trojanSid = `&sid=${encodeURIComponent(shortId)}`;
4712
+ }
4713
+ const spiderX = proxy["reality-opts"]?.["_spider-x"];
4714
+ if (spiderX) {
4715
+ trojanSpx = `&spx=${encodeURIComponent(spiderX)}`;
4716
+ }
4717
+ if (proxy._extra) {
4718
+ trojanExtra = `&extra=${encodeURIComponent(
4719
+ proxy._extra
4720
+ )}`;
4721
+ }
4722
+ if (proxy._mode) {
4723
+ trojanMode = `&mode=${encodeURIComponent(proxy._mode)}`;
4724
+ }
4725
+ }
4726
+ result = `trojan://${proxy.password}@${proxy.server}:${proxy.port}?sni=${encodeURIComponent(proxy.sni || proxy.server)}${proxy["skip-cert-verify"] ? "&allowInsecure=1" : ""}${trojanTransport}${trojanAlpn}${trojanFp}${trojanSecurity}${trojanSid}${trojanPbk}${trojanSpx}${trojanMode}${trojanExtra}#${encodeURIComponent(
4727
+ proxy.name
4728
+ )}`;
4104
4729
  break;
4105
4730
  case "hysteria2":
4106
4731
  let hysteria2params = [];
4732
+ if (proxy["hop-interval"]) {
4733
+ hysteria2params.push(
4734
+ `hop-interval=${proxy["hop-interval"]}`
4735
+ );
4736
+ }
4737
+ if (proxy["keepalive"]) {
4738
+ hysteria2params.push(`keepalive=${proxy["keepalive"]}`);
4739
+ }
4107
4740
  if (proxy["skip-cert-verify"]) {
4108
4741
  hysteria2params.push(`insecure=1`);
4109
4742
  }
@@ -4176,7 +4809,7 @@ function URI_Producer() {
4176
4809
  hysteriaParams.push(`obfsParam=${proxy[key]}`);
4177
4810
  } else if (["sni"].includes(key)) {
4178
4811
  hysteriaParams.push(`peer=${proxy[key]}`);
4179
- } else if (proxy[key]) {
4812
+ } else if (proxy[key] && !/^_/i.test(key)) {
4180
4813
  hysteriaParams.push(
4181
4814
  `${i}=${encodeURIComponent(proxy[key])}`
4182
4815
  );
@@ -4197,7 +4830,8 @@ function URI_Producer() {
4197
4830
  "uuid",
4198
4831
  "password",
4199
4832
  "server",
4200
- "port"
4833
+ "port",
4834
+ "tls"
4201
4835
  ].includes(key)) {
4202
4836
  const i = key.replace(/-/, "_");
4203
4837
  if (["alpn"].includes(key)) {
@@ -4217,10 +4851,17 @@ function URI_Producer() {
4217
4851
  tuicParams.push(`fast_open=1`);
4218
4852
  }
4219
4853
  } else if (["disable-sni", "reduce-rtt"].includes(key) && proxy[key]) {
4220
- tuicParams.push(`${i}=1`);
4221
- } else if (proxy[key]) {
4854
+ tuicParams.push(`${i.replace(/-/g, "_")}=1`);
4855
+ } else if (["congestion-controller"].includes(key)) {
4222
4856
  tuicParams.push(
4223
- `${i}=${encodeURIComponent(proxy[key])}`
4857
+ `congestion_control=${proxy[key]}`
4858
+ );
4859
+ } else if (proxy[key] && !/^_/i.test(key)) {
4860
+ tuicParams.push(
4861
+ `${i.replace(
4862
+ /-/g,
4863
+ "_"
4864
+ )}=${encodeURIComponent(proxy[key])}`
4224
4865
  );
4225
4866
  }
4226
4867
  }
@@ -4232,6 +4873,47 @@ function URI_Producer() {
4232
4873
  )}`;
4233
4874
  }
4234
4875
  break;
4876
+ case "anytls":
4877
+ let anytlsParams = [];
4878
+ Object.keys(proxy).forEach((key) => {
4879
+ if (![
4880
+ "name",
4881
+ "type",
4882
+ "password",
4883
+ "server",
4884
+ "port",
4885
+ "tls"
4886
+ ].includes(key)) {
4887
+ const i = key.replace(/-/, "_");
4888
+ if (["alpn"].includes(key)) {
4889
+ if (proxy[key]) {
4890
+ anytlsParams.push(
4891
+ `${i}=${encodeURIComponent(
4892
+ Array.isArray(proxy[key]) ? proxy[key][0] : proxy[key]
4893
+ )}`
4894
+ );
4895
+ }
4896
+ } else if (["skip-cert-verify"].includes(key)) {
4897
+ if (proxy[key]) {
4898
+ anytlsParams.push(`insecure=1`);
4899
+ }
4900
+ } else if (["udp"].includes(key)) {
4901
+ if (proxy[key]) {
4902
+ anytlsParams.push(`udp=1`);
4903
+ }
4904
+ } else if (proxy[key] && !/^_/i.test(key)) {
4905
+ anytlsParams.push(
4906
+ `${i.replace(/-/g, "_")}=${encodeURIComponent(
4907
+ proxy[key]
4908
+ )}`
4909
+ );
4910
+ }
4911
+ }
4912
+ });
4913
+ result = `anytls://${encodeURIComponent(proxy.password)}@${proxy.server}:${proxy.port}/?${anytlsParams.join("&")}#${encodeURIComponent(
4914
+ proxy.name
4915
+ )}`;
4916
+ break;
4235
4917
  case "wireguard":
4236
4918
  let wireguardParams = [];
4237
4919
  Object.keys(proxy).forEach((key) => {
@@ -4250,7 +4932,7 @@ function URI_Producer() {
4250
4932
  if (proxy[key]) {
4251
4933
  wireguardParams.push(`${key}=1`);
4252
4934
  }
4253
- } else if (proxy[key]) {
4935
+ } else if (proxy[key] && !/^_/i.test(key)) {
4254
4936
  wireguardParams.push(
4255
4937
  `${key}=${encodeURIComponent(proxy[key])}`
4256
4938
  );
@@ -4278,7 +4960,7 @@ function URI_Producer() {
4278
4960
  return { type, produce: produce2 };
4279
4961
  }
4280
4962
 
4281
- // Sub-Store/backend/src/core/proxy-utils/producers/v2ray.js
4963
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/v2ray.js
4282
4964
  import { Base64 as Base644 } from "js-base64";
4283
4965
  var URI = URI_Producer();
4284
4966
  function V2Ray_Producer() {
@@ -4304,13 +4986,13 @@ Reason: ${err}`
4304
4986
  return { type, produce: produce2 };
4305
4987
  }
4306
4988
 
4307
- // Sub-Store/backend/src/core/proxy-utils/producers/qx.js
4989
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/qx.js
4308
4990
  var targetPlatform4 = "QX";
4309
4991
  function QX_Producer() {
4310
4992
  const produce2 = (proxy, type, opts = {}) => {
4311
4993
  switch (proxy.type) {
4312
4994
  case "ss":
4313
- return shadowsocks3(proxy);
4995
+ return shadowsocks3(proxy, opts["include-unsupported-proxy"]);
4314
4996
  case "ssr":
4315
4997
  return shadowsocksr2(proxy);
4316
4998
  case "trojan":
@@ -4330,7 +5012,7 @@ function QX_Producer() {
4330
5012
  };
4331
5013
  return { produce: produce2 };
4332
5014
  }
4333
- function shadowsocks3(proxy) {
5015
+ function shadowsocks3(proxy, includeUnsupportedProxy) {
4334
5016
  const result = new Result(proxy);
4335
5017
  const append = result.append.bind(result);
4336
5018
  const appendIfPresent = result.appendIfPresent.bind(result);
@@ -4358,7 +5040,8 @@ function shadowsocks3(proxy) {
4358
5040
  "aes-192-gcm",
4359
5041
  "aes-256-gcm",
4360
5042
  "chacha20-ietf-poly1305",
4361
- "xchacha20-ietf-poly1305"
5043
+ "xchacha20-ietf-poly1305",
5044
+ ...includeUnsupportedProxy ? ["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm"] : []
4362
5045
  ].includes(proxy.cipher)) {
4363
5046
  throw new Error(`cipher ${proxy.cipher} is not supported`);
4364
5047
  }
@@ -4414,6 +5097,15 @@ function shadowsocks3(proxy) {
4414
5097
  }
4415
5098
  appendIfPresent(`,fast-open=${proxy.tfo}`, "tfo");
4416
5099
  appendIfPresent(`,udp-relay=${proxy.udp}`, "udp");
5100
+ if (proxy["_ssr_python_uot"]) {
5101
+ append(`,udp-over-tcp=true`);
5102
+ } else if (proxy["udp-over-tcp"]) {
5103
+ if (!proxy["udp-over-tcp-version"] || proxy["udp-over-tcp-version"] === 1) {
5104
+ append(`,udp-over-tcp=sp.v1`);
5105
+ } else if (proxy["udp-over-tcp-version"] === 2) {
5106
+ append(`,udp-over-tcp=sp.v2`);
5107
+ }
5108
+ }
4417
5109
  result.appendIfPresent(
4418
5110
  `,server_check_url=${proxy["test-url"]}`,
4419
5111
  "test-url"
@@ -4739,14 +5431,21 @@ function needTls(proxy) {
4739
5431
  return proxy.tls;
4740
5432
  }
4741
5433
 
4742
- // Sub-Store/backend/src/core/proxy-utils/producers/shadowrocket.js
4743
- function ShadowRocket_Producer() {
5434
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/shadowrocket.js
5435
+ function Shadowrocket_Producer() {
4744
5436
  const type = "ALL";
4745
5437
  const produce2 = (proxies, type2, opts = {}) => {
4746
5438
  const list = proxies.filter((proxy) => {
4747
5439
  if (opts["include-unsupported-proxy"]) return true;
4748
5440
  if (proxy.type === "snell" && String(proxy.version) === "4") {
4749
5441
  return false;
5442
+ } else if (["mieru", "anytls"].includes(proxy.type)) {
5443
+ return false;
5444
+ } else if (proxy["underlying-proxy"] || proxy["dialer-proxy"]) {
5445
+ app_default.error(
5446
+ `Shadowrocket \u4E0D\u652F\u6301\u524D\u7F6E\u4EE3\u7406\u5B57\u6BB5. \u5DF2\u8FC7\u6EE4\u8282\u70B9 ${proxy.name}. \u8BF7\u4F7F\u7528 App \u5185\u7684 "\u4EE3\u7406\u901A\u8FC7" \u529F\u80FD`
5447
+ );
5448
+ return false;
4750
5449
  }
4751
5450
  return true;
4752
5451
  }).map((proxy) => {
@@ -4763,9 +5462,10 @@ function ShadowRocket_Producer() {
4763
5462
  }
4764
5463
  if (isPresent2(proxy, "cipher") && ![
4765
5464
  "auto",
5465
+ "none",
5466
+ "zero",
4766
5467
  "aes-128-gcm",
4767
- "chacha20-poly1305",
4768
- "none"
5468
+ "chacha20-poly1305"
4769
5469
  ].includes(proxy.cipher)) {
4770
5470
  proxy.cipher = "auto";
4771
5471
  }
@@ -4807,11 +5507,25 @@ function ShadowRocket_Producer() {
4807
5507
  proxy["persistent-keepalive"] = proxy.keepalive;
4808
5508
  proxy["preshared-key"] = proxy["preshared-key"] ?? proxy["pre-shared-key"];
4809
5509
  proxy["pre-shared-key"] = proxy["preshared-key"];
5510
+ } else if (proxy.type === "snell" && proxy.version < 3) {
5511
+ delete proxy.udp;
4810
5512
  } else if (proxy.type === "vless") {
4811
5513
  if (isPresent2(proxy, "sni")) {
4812
5514
  proxy.servername = proxy.sni;
4813
5515
  delete proxy.sni;
4814
5516
  }
5517
+ } else if (proxy.type === "ss") {
5518
+ if (isPresent2(proxy, "shadow-tls-password") && !isPresent2(proxy, "plugin")) {
5519
+ proxy.plugin = "shadow-tls";
5520
+ proxy["plugin-opts"] = {
5521
+ host: proxy["shadow-tls-sni"],
5522
+ password: proxy["shadow-tls-password"],
5523
+ version: proxy["shadow-tls-version"]
5524
+ };
5525
+ delete proxy["shadow-tls-password"];
5526
+ delete proxy["shadow-tls-sni"];
5527
+ delete proxy["shadow-tls-version"];
5528
+ }
4815
5529
  }
4816
5530
  if (["vmess", "vless"].includes(proxy.type) && proxy.network === "http") {
4817
5531
  let httpPath = proxy["http-opts"]?.path;
@@ -4843,7 +5557,8 @@ function ShadowRocket_Producer() {
4843
5557
  "tuic",
4844
5558
  "hysteria",
4845
5559
  "hysteria2",
4846
- "juicity"
5560
+ "juicity",
5561
+ "anytls"
4847
5562
  ].includes(proxy.type)) {
4848
5563
  delete proxy.tls;
4849
5564
  }
@@ -4872,6 +5587,7 @@ function ShadowRocket_Producer() {
4872
5587
  }
4873
5588
  if (["grpc"].includes(proxy.network) && proxy[`${proxy.network}-opts`]) {
4874
5589
  delete proxy[`${proxy.network}-opts`]["_grpc-type"];
5590
+ delete proxy[`${proxy.network}-opts`]["_grpc-authority"];
4875
5591
  }
4876
5592
  return proxy;
4877
5593
  });
@@ -4882,7 +5598,7 @@ function ShadowRocket_Producer() {
4882
5598
  return { type, produce: produce2 };
4883
5599
  }
4884
5600
 
4885
- // Sub-Store/backend/src/core/proxy-utils/producers/surfboard.js
5601
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/surfboard.js
4886
5602
  var targetPlatform5 = "Surfboard";
4887
5603
  function Surfboard_Producer() {
4888
5604
  const produce2 = (proxy) => {
@@ -5054,9 +5770,13 @@ function handleTransport2(result, proxy) {
5054
5770
  }
5055
5771
  }
5056
5772
 
5057
- // Sub-Store/backend/src/core/proxy-utils/producers/sing-box.js
5773
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/sing-box.js
5058
5774
  var detourParser = (proxy, parsedProxy) => {
5059
- if (proxy["dialer-proxy"]) parsedProxy.detour = proxy["dialer-proxy"];
5775
+ parsedProxy.detour = proxy["dialer-proxy"] || proxy.detour;
5776
+ };
5777
+ var networkParser = (proxy, parsedProxy) => {
5778
+ if (["tcp", "udp"].includes(proxy._network))
5779
+ parsedProxy.network = proxy._network;
5060
5780
  };
5061
5781
  var tfoParser = (proxy, parsedProxy) => {
5062
5782
  parsedProxy.tcp_fast_open = false;
@@ -5079,6 +5799,21 @@ var smuxParser = (smux, proxy) => {
5079
5799
  if (smux["min-streams"])
5080
5800
  proxy.multiplex.min_streams = parseInt(`${smux["min-streams"]}`, 10);
5081
5801
  if (smux.padding) proxy.multiplex.padding = true;
5802
+ if (smux["brutal-opts"]?.up || smux["brutal-opts"]?.down) {
5803
+ proxy.multiplex.brutal = {
5804
+ enabled: true
5805
+ };
5806
+ if (smux["brutal-opts"]?.up)
5807
+ proxy.multiplex.brutal.up_mbps = parseInt(
5808
+ `${smux["brutal-opts"]?.up}`,
5809
+ 10
5810
+ );
5811
+ if (smux["brutal-opts"]?.down)
5812
+ proxy.multiplex.brutal.down_mbps = parseInt(
5813
+ `${smux["brutal-opts"]?.down}`,
5814
+ 10
5815
+ );
5816
+ }
5082
5817
  };
5083
5818
  var wsParser = (proxy, parsedProxy) => {
5084
5819
  const transport = { type: "ws", headers: {} };
@@ -5257,7 +5992,7 @@ var tlsParser = (proxy, parsedProxy) => {
5257
5992
  parsedProxy.tls.reality.short_id = proxy["reality-opts"]["short-id"];
5258
5993
  parsedProxy.tls.utls = { enabled: true };
5259
5994
  }
5260
- if (proxy["client-fingerprint"] && proxy["client-fingerprint"] !== "")
5995
+ if (!["hysteria", "hysteria2", "tuic"].includes(proxy.type) && proxy["client-fingerprint"] && proxy["client-fingerprint"] !== "")
5261
5996
  parsedProxy.tls.utls = {
5262
5997
  enabled: true,
5263
5998
  fingerprint: proxy["client-fingerprint"]
@@ -5336,6 +6071,7 @@ var socks5Parser = (proxy = {}) => {
5336
6071
  if (proxy.uot) parsedProxy.udp_over_tcp = true;
5337
6072
  if (proxy["udp-over-tcp"]) parsedProxy.udp_over_tcp = true;
5338
6073
  if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
6074
+ networkParser(proxy, parsedProxy);
5339
6075
  tfoParser(proxy, parsedProxy);
5340
6076
  detourParser(proxy, parsedProxy);
5341
6077
  return parsedProxy;
@@ -5384,8 +6120,14 @@ var ssParser = (proxy = {}) => {
5384
6120
  if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
5385
6121
  throw "invalid port";
5386
6122
  if (proxy.uot) parsedProxy.udp_over_tcp = true;
5387
- if (proxy["udp-over-tcp"]) parsedProxy.udp_over_tcp = true;
6123
+ if (proxy["udp-over-tcp"]) {
6124
+ parsedProxy.udp_over_tcp = {
6125
+ enabled: true,
6126
+ version: !proxy["udp-over-tcp-version"] || proxy["udp-over-tcp-version"] === 1 ? 1 : 2
6127
+ };
6128
+ }
5388
6129
  if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
6130
+ networkParser(proxy, parsedProxy);
5389
6131
  tfoParser(proxy, parsedProxy);
5390
6132
  detourParser(proxy, parsedProxy);
5391
6133
  smuxParser(proxy.smux, parsedProxy);
@@ -5495,6 +6237,7 @@ var vmessParser = (proxy = {}) => {
5495
6237
  if (proxy.network === "h2") h2Parser(proxy, parsedProxy);
5496
6238
  if (proxy.network === "http") h1Parser(proxy, parsedProxy);
5497
6239
  if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
6240
+ networkParser(proxy, parsedProxy);
5498
6241
  tfoParser(proxy, parsedProxy);
5499
6242
  detourParser(proxy, parsedProxy);
5500
6243
  tlsParser(proxy, parsedProxy);
@@ -5516,6 +6259,7 @@ var vlessParser = (proxy = {}) => {
5516
6259
  if (proxy.flow === "xtls-rprx-vision") parsedProxy.flow = proxy.flow;
5517
6260
  if (proxy.network === "ws") wsParser(proxy, parsedProxy);
5518
6261
  if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
6262
+ networkParser(proxy, parsedProxy);
5519
6263
  tfoParser(proxy, parsedProxy);
5520
6264
  detourParser(proxy, parsedProxy);
5521
6265
  smuxParser(proxy.smux, parsedProxy);
@@ -5536,6 +6280,7 @@ var trojanParser = (proxy = {}) => {
5536
6280
  if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
5537
6281
  if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
5538
6282
  if (proxy.network === "ws") wsParser(proxy, parsedProxy);
6283
+ networkParser(proxy, parsedProxy);
5539
6284
  tfoParser(proxy, parsedProxy);
5540
6285
  detourParser(proxy, parsedProxy);
5541
6286
  tlsParser(proxy, parsedProxy);
@@ -5557,12 +6302,12 @@ var hysteriaParser = (proxy = {}) => {
5557
6302
  if (proxy["auth-str"]) parsedProxy.auth_str = `${proxy["auth-str"]}`;
5558
6303
  if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
5559
6304
  const reg = new RegExp("^[0-9]+[ ]*[KMGT]*[Bb]ps$");
5560
- if (reg.test(`${proxy.up}`)) {
6305
+ if (reg.test(`${proxy.up}`) && !`${proxy.up}`.endsWith("Mbps")) {
5561
6306
  parsedProxy.up = `${proxy.up}`;
5562
6307
  } else {
5563
6308
  parsedProxy.up_mbps = parseInt(`${proxy.up}`, 10);
5564
6309
  }
5565
- if (reg.test(`${proxy.down}`)) {
6310
+ if (reg.test(`${proxy.down}`) && !`${proxy.down}`.endsWith("Mbps")) {
5566
6311
  parsedProxy.down = `${proxy.down}`;
5567
6312
  } else {
5568
6313
  parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);
@@ -5582,6 +6327,7 @@ var hysteriaParser = (proxy = {}) => {
5582
6327
  parsedProxy.disable_mtu_discovery = true;
5583
6328
  }
5584
6329
  }
6330
+ networkParser(proxy, parsedProxy);
5585
6331
  tlsParser(proxy, parsedProxy);
5586
6332
  detourParser(proxy, parsedProxy);
5587
6333
  tfoParser(proxy, parsedProxy);
@@ -5600,12 +6346,17 @@ var hysteria2Parser = (proxy = {}) => {
5600
6346
  };
5601
6347
  if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
5602
6348
  throw "invalid port";
6349
+ if (proxy["hop-interval"])
6350
+ parsedProxy.hop_interval = /^\d+$/.test(proxy["hop-interval"]) ? `${proxy["hop-interval"]}s` : proxy["hop-interval"];
6351
+ if (proxy["ports"])
6352
+ parsedProxy.server_ports = proxy["ports"].split(/\s*,\s*/).map((p) => p.replace(/\s*-\s*/g, ":"));
5603
6353
  if (proxy.up) parsedProxy.up_mbps = parseInt(`${proxy.up}`, 10);
5604
6354
  if (proxy.down) parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);
5605
6355
  if (proxy.obfs === "salamander") parsedProxy.obfs.type = "salamander";
5606
6356
  if (proxy["obfs-password"])
5607
6357
  parsedProxy.obfs.password = proxy["obfs-password"];
5608
6358
  if (!parsedProxy.obfs.type) delete parsedProxy.obfs;
6359
+ networkParser(proxy, parsedProxy);
5609
6360
  tlsParser(proxy, parsedProxy);
5610
6361
  tfoParser(proxy, parsedProxy);
5611
6362
  detourParser(proxy, parsedProxy);
@@ -5633,12 +6384,30 @@ var tuic5Parser = (proxy = {}) => {
5633
6384
  if (proxy["udp-over-stream"]) parsedProxy.udp_over_stream = true;
5634
6385
  if (proxy["heartbeat-interval"])
5635
6386
  parsedProxy.heartbeat = `${proxy["heartbeat-interval"]}ms`;
6387
+ networkParser(proxy, parsedProxy);
5636
6388
  tfoParser(proxy, parsedProxy);
5637
6389
  detourParser(proxy, parsedProxy);
5638
6390
  tlsParser(proxy, parsedProxy);
5639
6391
  smuxParser(proxy.smux, parsedProxy);
5640
6392
  return parsedProxy;
5641
6393
  };
6394
+ var anytlsParser = (proxy = {}) => {
6395
+ const parsedProxy = {
6396
+ tag: proxy.name,
6397
+ type: "anytls",
6398
+ server: proxy.server,
6399
+ server_port: parseInt(`${proxy.port}`, 10),
6400
+ password: proxy.password,
6401
+ tls: { enabled: true, server_name: proxy.server, insecure: false }
6402
+ };
6403
+ if (/^\d+$/.test(proxy["idle-session-check-interval"]))
6404
+ parsedProxy.idle_session_check_interval = `${proxy["idle-session-check-interval"]}s`;
6405
+ if (/^\d+$/.test(proxy["idle-session-timeout"]))
6406
+ parsedProxy.idle_session_timeout = `${proxy["idle-session-timeout"]}s`;
6407
+ detourParser(proxy, parsedProxy);
6408
+ tlsParser(proxy, parsedProxy);
6409
+ return parsedProxy;
6410
+ };
5642
6411
  var wireguardParser = (proxy = {}) => {
5643
6412
  const local_address = ["ip", "ipv6"].map((i) => proxy[i]).map((i) => {
5644
6413
  if (isIPv4(i)) return `${i}/32`;
@@ -5686,6 +6455,7 @@ var wireguardParser = (proxy = {}) => {
5686
6455
  parsedProxy.peers.push(peer);
5687
6456
  }
5688
6457
  }
6458
+ networkParser(proxy, parsedProxy);
5689
6459
  tfoParser(proxy, parsedProxy);
5690
6460
  detourParser(proxy, parsedProxy);
5691
6461
  smuxParser(proxy.smux, parsedProxy);
@@ -5764,7 +6534,12 @@ function singbox_Producer() {
5764
6534
  list.push(hysteriaParser(proxy));
5765
6535
  break;
5766
6536
  case "hysteria2":
5767
- list.push(hysteria2Parser(proxy));
6537
+ list.push(
6538
+ hysteria2Parser(
6539
+ proxy,
6540
+ opts["include-unsupported-proxy"]
6541
+ )
6542
+ );
5768
6543
  break;
5769
6544
  case "tuic":
5770
6545
  if (!proxy.token || proxy.token.length === 0) {
@@ -5778,6 +6553,9 @@ function singbox_Producer() {
5778
6553
  case "wireguard":
5779
6554
  list.push(wireguardParser(proxy));
5780
6555
  break;
6556
+ case "anytls":
6557
+ list.push(anytlsParser(proxy));
6558
+ break;
5781
6559
  default:
5782
6560
  throw new Error(
5783
6561
  `Platform sing-box does not support proxy type: ${proxy.type}`
@@ -5792,28 +6570,368 @@ function singbox_Producer() {
5792
6570
  return { type, produce: produce2 };
5793
6571
  }
5794
6572
 
5795
- // Sub-Store/backend/src/core/proxy-utils/producers/index.js
6573
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/egern.js
6574
+ function Egern_Producer() {
6575
+ const type = "ALL";
6576
+ const produce2 = (proxies, type2) => {
6577
+ const list = proxies.filter((proxy) => {
6578
+ if (![
6579
+ "http",
6580
+ "socks5",
6581
+ "ss",
6582
+ "trojan",
6583
+ "hysteria2",
6584
+ "vless",
6585
+ "vmess",
6586
+ "tuic"
6587
+ ].includes(proxy.type) || proxy.type === "ss" && (proxy.plugin === "obfs" && !["http", "tls"].includes(
6588
+ proxy["plugin-opts"]?.mode
6589
+ ) || ![
6590
+ "chacha20-ietf-poly1305",
6591
+ "chacha20-poly1305",
6592
+ "aes-256-gcm",
6593
+ "aes-128-gcm",
6594
+ "none",
6595
+ "tbale",
6596
+ "rc4",
6597
+ "rc4-md5",
6598
+ "aes-128-cfb",
6599
+ "aes-192-cfb",
6600
+ "aes-256-cfb",
6601
+ "aes-128-ctr",
6602
+ "aes-192-ctr",
6603
+ "aes-256-ctr",
6604
+ "bf-cfb",
6605
+ "camellia-128-cfb",
6606
+ "camellia-192-cfb",
6607
+ "camellia-256-cfb",
6608
+ "cast5-cfb",
6609
+ "des-cfb",
6610
+ "idea-cfb",
6611
+ "rc2-cfb",
6612
+ "seed-cfb",
6613
+ "salsa20",
6614
+ "chacha20",
6615
+ "chacha20-ietf",
6616
+ "2022-blake3-aes-128-gcm",
6617
+ "2022-blake3-aes-256-gcm"
6618
+ ].includes(proxy.cipher)) || proxy.type === "vmess" && !["http", "ws", "tcp"].includes(proxy.network) && proxy.network || proxy.type === "trojan" && !["http", "ws", "tcp"].includes(proxy.network) && proxy.network || proxy.type === "vless" && (typeof proxy.flow !== "undefined" || proxy["reality-opts"] || !["http", "ws", "tcp"].includes(proxy.network) && proxy.network) || proxy.type === "tuic" && proxy.token && proxy.token.length !== 0) {
6619
+ return false;
6620
+ }
6621
+ return true;
6622
+ }).map((proxy) => {
6623
+ const original = { ...proxy };
6624
+ if (proxy.tls && !proxy.sni) {
6625
+ proxy.sni = proxy.server;
6626
+ }
6627
+ const prev_hop = proxy.prev_hop || proxy["underlying-proxy"] || proxy["dialer-proxy"] || proxy.detour;
6628
+ if (proxy.type === "http") {
6629
+ proxy = {
6630
+ type: "http",
6631
+ name: proxy.name,
6632
+ server: proxy.server,
6633
+ port: proxy.port,
6634
+ username: proxy.username,
6635
+ password: proxy.password,
6636
+ tfo: proxy.tfo || proxy["fast-open"],
6637
+ next_hop: proxy.next_hop
6638
+ };
6639
+ } else if (proxy.type === "socks5") {
6640
+ proxy = {
6641
+ type: "socks5",
6642
+ name: proxy.name,
6643
+ server: proxy.server,
6644
+ port: proxy.port,
6645
+ username: proxy.username,
6646
+ password: proxy.password,
6647
+ tfo: proxy.tfo || proxy["fast-open"],
6648
+ udp_relay: proxy.udp || proxy.udp_relay || proxy.udp_relay,
6649
+ next_hop: proxy.next_hop
6650
+ };
6651
+ } else if (proxy.type === "ss") {
6652
+ proxy = {
6653
+ type: "shadowsocks",
6654
+ name: proxy.name,
6655
+ method: proxy.cipher === "chacha20-ietf-poly1305" ? "chacha20-poly1305" : proxy.cipher,
6656
+ server: proxy.server,
6657
+ port: proxy.port,
6658
+ password: proxy.password,
6659
+ tfo: proxy.tfo || proxy["fast-open"],
6660
+ udp_relay: proxy.udp || proxy.udp_relay || proxy.udp_relay,
6661
+ next_hop: proxy.next_hop
6662
+ };
6663
+ if (original.plugin === "obfs") {
6664
+ proxy.obfs = original["plugin-opts"].mode;
6665
+ proxy.obfs_host = original["plugin-opts"].host;
6666
+ proxy.obfs_uri = original["plugin-opts"].path;
6667
+ }
6668
+ } else if (proxy.type === "hysteria2") {
6669
+ proxy = {
6670
+ type: "hysteria2",
6671
+ name: proxy.name,
6672
+ server: proxy.server,
6673
+ port: proxy.port,
6674
+ auth: proxy.password,
6675
+ tfo: proxy.tfo || proxy["fast-open"],
6676
+ udp_relay: proxy.udp || proxy.udp_relay || proxy.udp_relay,
6677
+ next_hop: proxy.next_hop,
6678
+ sni: proxy.sni,
6679
+ skip_tls_verify: proxy["skip-cert-verify"],
6680
+ port_hopping: proxy.ports,
6681
+ port_hopping_interval: proxy["hop-interval"]
6682
+ };
6683
+ if (original["obfs-password"] && original.obfs == "salamander") {
6684
+ proxy.obfs = "salamander";
6685
+ proxy.obfs_password = original["obfs-password"];
6686
+ }
6687
+ } else if (proxy.type === "tuic") {
6688
+ proxy = {
6689
+ type: "tuic",
6690
+ name: proxy.name,
6691
+ server: proxy.server,
6692
+ port: proxy.port,
6693
+ uuid: proxy.uuid,
6694
+ password: proxy.password,
6695
+ next_hop: proxy.next_hop,
6696
+ sni: proxy.sni,
6697
+ alpn: Array.isArray(proxy.alpn) ? proxy.alpn : [proxy.alpn || "h3"],
6698
+ skip_tls_verify: proxy["skip-cert-verify"],
6699
+ port_hopping: proxy.ports,
6700
+ port_hopping_interval: proxy["hop-interval"]
6701
+ };
6702
+ } else if (proxy.type === "trojan") {
6703
+ if (proxy.network === "ws") {
6704
+ proxy.websocket = {
6705
+ path: proxy["ws-opts"]?.path,
6706
+ host: proxy["ws-opts"]?.headers?.Host
6707
+ };
6708
+ }
6709
+ proxy = {
6710
+ type: "trojan",
6711
+ name: proxy.name,
6712
+ server: proxy.server,
6713
+ port: proxy.port,
6714
+ password: proxy.password,
6715
+ tfo: proxy.tfo || proxy["fast-open"],
6716
+ udp_relay: proxy.udp || proxy.udp_relay || proxy.udp_relay,
6717
+ next_hop: proxy.next_hop,
6718
+ sni: proxy.sni,
6719
+ skip_tls_verify: proxy["skip-cert-verify"],
6720
+ websocket: proxy.websocket
6721
+ };
6722
+ } else if (proxy.type === "vmess") {
6723
+ let security = proxy.cipher;
6724
+ if (security && ![
6725
+ "auto",
6726
+ "none",
6727
+ "zero",
6728
+ "aes-128-gcm",
6729
+ "chacha20-poly1305"
6730
+ ].includes(security)) {
6731
+ security = "auto";
6732
+ }
6733
+ if (proxy.network === "ws") {
6734
+ proxy.transport = {
6735
+ [proxy.tls ? "wss" : "ws"]: {
6736
+ path: proxy["ws-opts"]?.path,
6737
+ headers: {
6738
+ Host: proxy["ws-opts"]?.headers?.Host
6739
+ },
6740
+ sni: proxy.tls ? proxy.sni : void 0,
6741
+ skip_tls_verify: proxy.tls ? proxy["skip-cert-verify"] : void 0
6742
+ }
6743
+ };
6744
+ } else if (proxy.network === "http") {
6745
+ proxy.transport = {
6746
+ http1: {
6747
+ method: proxy["http-opts"]?.method,
6748
+ path: Array.isArray(proxy["http-opts"]?.path) ? proxy["http-opts"]?.path[0] : proxy["http-opts"]?.path,
6749
+ headers: {
6750
+ Host: Array.isArray(
6751
+ proxy["http-opts"]?.headers?.Host
6752
+ ) ? proxy["http-opts"]?.headers?.Host[0] : proxy["http-opts"]?.headers?.Host
6753
+ },
6754
+ skip_tls_verify: proxy["skip-cert-verify"]
6755
+ }
6756
+ };
6757
+ } else if (proxy.network === "h2") {
6758
+ proxy.transport = {
6759
+ http2: {
6760
+ method: proxy["h2-opts"]?.method,
6761
+ path: Array.isArray(proxy["h2-opts"]?.path) ? proxy["h2-opts"]?.path[0] : proxy["h2-opts"]?.path,
6762
+ headers: {
6763
+ Host: Array.isArray(
6764
+ proxy["h2-opts"]?.headers?.Host
6765
+ ) ? proxy["h2-opts"]?.headers?.Host[0] : proxy["h2-opts"]?.headers?.Host
6766
+ },
6767
+ skip_tls_verify: proxy["skip-cert-verify"]
6768
+ }
6769
+ };
6770
+ } else if ((proxy.network === "tcp" || !proxy.network) && proxy.tls) {
6771
+ proxy.transport = {
6772
+ tls: {
6773
+ sni: proxy.tls ? proxy.sni : void 0,
6774
+ skip_tls_verify: proxy.tls ? proxy["skip-cert-verify"] : void 0
6775
+ }
6776
+ };
6777
+ }
6778
+ proxy = {
6779
+ type: "vmess",
6780
+ name: proxy.name,
6781
+ server: proxy.server,
6782
+ port: proxy.port,
6783
+ user_id: proxy.uuid,
6784
+ security,
6785
+ tfo: proxy.tfo || proxy["fast-open"],
6786
+ legacy: proxy.legacy,
6787
+ udp_relay: proxy.udp || proxy.udp_relay || proxy.udp_relay,
6788
+ next_hop: proxy.next_hop,
6789
+ transport: proxy.transport
6790
+ // sni: proxy.sni,
6791
+ // skip_tls_verify: proxy['skip-cert-verify'],
6792
+ };
6793
+ } else if (proxy.type === "vless") {
6794
+ if (proxy.network === "ws") {
6795
+ proxy.transport = {
6796
+ [proxy.tls ? "wss" : "ws"]: {
6797
+ path: proxy["ws-opts"]?.path,
6798
+ headers: {
6799
+ Host: proxy["ws-opts"]?.headers?.Host
6800
+ },
6801
+ sni: proxy.tls ? proxy.sni : void 0,
6802
+ skip_tls_verify: proxy.tls ? proxy["skip-cert-verify"] : void 0
6803
+ }
6804
+ };
6805
+ } else if (proxy.network === "http") {
6806
+ proxy.transport = {
6807
+ http: {
6808
+ method: proxy["http-opts"]?.method,
6809
+ path: Array.isArray(proxy["http-opts"]?.path) ? proxy["http-opts"]?.path[0] : proxy["http-opts"]?.path,
6810
+ headers: {
6811
+ Host: Array.isArray(
6812
+ proxy["http-opts"]?.headers?.Host
6813
+ ) ? proxy["http-opts"]?.headers?.Host[0] : proxy["http-opts"]?.headers?.Host
6814
+ },
6815
+ skip_tls_verify: proxy["skip-cert-verify"]
6816
+ }
6817
+ };
6818
+ } else if (proxy.network === "tcp" || !proxy.network) {
6819
+ proxy.transport = {
6820
+ [proxy.tls ? "tls" : "tcp"]: {
6821
+ sni: proxy.tls ? proxy.sni : void 0,
6822
+ skip_tls_verify: proxy.tls ? proxy["skip-cert-verify"] : void 0
6823
+ }
6824
+ };
6825
+ }
6826
+ proxy = {
6827
+ type: "vless",
6828
+ name: proxy.name,
6829
+ server: proxy.server,
6830
+ port: proxy.port,
6831
+ user_id: proxy.uuid,
6832
+ security: proxy.cipher,
6833
+ tfo: proxy.tfo || proxy["fast-open"],
6834
+ legacy: proxy.legacy,
6835
+ udp_relay: proxy.udp || proxy.udp_relay || proxy.udp_relay,
6836
+ next_hop: proxy.next_hop,
6837
+ transport: proxy.transport
6838
+ // sni: proxy.sni,
6839
+ // skip_tls_verify: proxy['skip-cert-verify'],
6840
+ };
6841
+ }
6842
+ if ([
6843
+ "http",
6844
+ "socks5",
6845
+ "ss",
6846
+ "trojan",
6847
+ "vless",
6848
+ "vmess"
6849
+ ].includes(original.type)) {
6850
+ if (isPresent2(original, "shadow-tls-password")) {
6851
+ if (original["shadow-tls-version"] != 3)
6852
+ throw new Error(
6853
+ `shadow-tls version ${original["shadow-tls-version"]} is not supported`
6854
+ );
6855
+ proxy.shadow_tls = {
6856
+ password: original["shadow-tls-password"],
6857
+ sni: original["shadow-tls-sni"]
6858
+ };
6859
+ } else if (["shadow-tls"].includes(original.plugin) && original["plugin-opts"]) {
6860
+ if (original["plugin-opts"].version != 3)
6861
+ throw new Error(
6862
+ `shadow-tls version ${original["plugin-opts"].version} is not supported`
6863
+ );
6864
+ proxy.shadow_tls = {
6865
+ password: original["plugin-opts"].password,
6866
+ sni: original["plugin-opts"].host
6867
+ };
6868
+ }
6869
+ }
6870
+ delete proxy.subName;
6871
+ delete proxy.collectionName;
6872
+ delete proxy.id;
6873
+ delete proxy.resolved;
6874
+ delete proxy["no-resolve"];
6875
+ if (type2 !== "internal") {
6876
+ for (const key in proxy) {
6877
+ if (proxy[key] == null || /^_/i.test(key)) {
6878
+ delete proxy[key];
6879
+ }
6880
+ }
6881
+ }
6882
+ return {
6883
+ [proxy.type]: {
6884
+ ...proxy,
6885
+ type: void 0,
6886
+ prev_hop
6887
+ }
6888
+ };
6889
+ });
6890
+ return type2 === "internal" ? list : "proxies:\n" + list.map((proxy) => " - " + JSON.stringify(proxy) + "\n").join("");
6891
+ };
6892
+ return { type, produce: produce2 };
6893
+ }
6894
+
6895
+ // src/vendors/Sub-Store/backend/src/core/proxy-utils/producers/index.js
5796
6896
  function JSON_Producer() {
5797
6897
  const type = "ALL";
5798
6898
  const produce2 = (proxies, type2) => type2 === "internal" ? proxies : JSON.stringify(proxies, null, 2);
5799
6899
  return { type, produce: produce2 };
5800
6900
  }
5801
6901
  var producers_default = {
6902
+ qx: QX_Producer(),
5802
6903
  QX: QX_Producer(),
5803
6904
  QuantumultX: QX_Producer(),
6905
+ surge: Surge_Producer(),
5804
6906
  Surge: Surge_Producer(),
5805
6907
  SurgeMac: SurgeMac_Producer(),
5806
6908
  Loon: Loon_Producer(),
5807
6909
  Clash: Clash_Producer(),
6910
+ meta: ClashMeta_Producer(),
6911
+ clashmeta: ClashMeta_Producer(),
6912
+ "clash.meta": ClashMeta_Producer(),
6913
+ "Clash.Meta": ClashMeta_Producer(),
5808
6914
  ClashMeta: ClashMeta_Producer(),
6915
+ mihomo: ClashMeta_Producer(),
6916
+ Mihomo: ClashMeta_Producer(),
6917
+ uri: URI_Producer(),
5809
6918
  URI: URI_Producer(),
6919
+ v2: V2Ray_Producer(),
6920
+ v2ray: V2Ray_Producer(),
5810
6921
  V2Ray: V2Ray_Producer(),
6922
+ json: JSON_Producer(),
5811
6923
  JSON: JSON_Producer(),
6924
+ stash: Stash_Producer(),
5812
6925
  Stash: Stash_Producer(),
5813
- Shadowrocket: ShadowRocket_Producer(),
5814
- ShadowRocket: ShadowRocket_Producer(),
6926
+ shadowrocket: Shadowrocket_Producer(),
6927
+ Shadowrocket: Shadowrocket_Producer(),
6928
+ ShadowRocket: Shadowrocket_Producer(),
6929
+ surfboard: Surfboard_Producer(),
5815
6930
  Surfboard: Surfboard_Producer(),
5816
- "sing-box": singbox_Producer()
6931
+ singbox: singbox_Producer(),
6932
+ "sing-box": singbox_Producer(),
6933
+ egern: Egern_Producer(),
6934
+ Egern: Egern_Producer()
5817
6935
  };
5818
6936
 
5819
6937
  // src/index.js