sub-store-convert 2.14.385 → 2.14.418
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.
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/{core-export.js → build/index.js} +195 -280
- package/package.json +14 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 tbxark
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target2, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target2, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/index.js
|
|
8
|
+
var parsers_exports = {};
|
|
9
|
+
__export(parsers_exports, {
|
|
10
|
+
default: () => parsers_default
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
// Sub-Store/backend/src/utils/index.js
|
|
2
14
|
import * as ipAddress from "ip-address";
|
|
3
15
|
var IPV4_REGEX = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/;
|
|
4
16
|
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 +48,7 @@ function getRandomPort(portString) {
|
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
|
|
39
|
-
// src/core/proxy-utils/parsers/peggy/surge.js
|
|
51
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/peggy/surge.js
|
|
40
52
|
import * as peggy from "peggy";
|
|
41
53
|
var grammars = String.raw`
|
|
42
54
|
// global initializer
|
|
@@ -80,7 +92,7 @@ start = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls/tuic/tuic_v
|
|
|
80
92
|
return proxy;
|
|
81
93
|
}
|
|
82
94
|
|
|
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/others)* {
|
|
95
|
+
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)* {
|
|
84
96
|
proxy.type = "ss";
|
|
85
97
|
// handle obfs
|
|
86
98
|
if (obfs.type == "http" || obfs.type === "tls") {
|
|
@@ -239,7 +251,7 @@ vmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }
|
|
|
239
251
|
method = comma "encrypt-method" equals cipher:cipher {
|
|
240
252
|
proxy.cipher = cipher;
|
|
241
253
|
}
|
|
242
|
-
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"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"idea-cfb"/"none"/"rc2-cfb"/"rc4-md5"/"rc4"/"salsa20"/"seed-cfb"/"xchacha20-ietf-poly1305");
|
|
254
|
+
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"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"idea-cfb"/"none"/"rc2-cfb"/"rc4-md5"/"rc4"/"salsa20"/"seed-cfb"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
|
|
243
255
|
|
|
244
256
|
ws = comma "ws" equals flag:bool { obfs.type = "ws"; }
|
|
245
257
|
ws_headers = comma "ws-headers" equals headers:$[^,]+ {
|
|
@@ -258,7 +270,7 @@ obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };
|
|
|
258
270
|
obfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }
|
|
259
271
|
uri = $[^,]+
|
|
260
272
|
|
|
261
|
-
udp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }
|
|
273
|
+
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
|
|
262
274
|
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
|
|
263
275
|
reuse = comma "reuse" equals flag:bool { proxy.reuse = flag; }
|
|
264
276
|
ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
|
|
@@ -279,6 +291,7 @@ idle_timeout = comma "idle-timeout" equals match:$[0-9]+ { proxy["idle-timeout"]
|
|
|
279
291
|
private_key = comma "private-key" equals match:[^,]+ { proxy["keystore-private-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|
280
292
|
server_fingerprint = comma "server-fingerprint" equals match:[^,]+ { proxy["server-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|
281
293
|
block_quic = comma "block-quic" equals match:[^,]+ { proxy["block-quic"] = match.join(""); }
|
|
294
|
+
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
|
|
282
295
|
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
|
|
283
296
|
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
|
|
284
297
|
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
|
|
@@ -301,7 +314,7 @@ function getParser() {
|
|
|
301
314
|
return parser;
|
|
302
315
|
}
|
|
303
316
|
|
|
304
|
-
// src/core/proxy-utils/parsers/peggy/loon.js
|
|
317
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/peggy/loon.js
|
|
305
318
|
import * as peggy2 from "peggy";
|
|
306
319
|
var grammars2 = String.raw`
|
|
307
320
|
// global initializer
|
|
@@ -501,7 +514,7 @@ function getParser2() {
|
|
|
501
514
|
return parser2;
|
|
502
515
|
}
|
|
503
516
|
|
|
504
|
-
// src/core/proxy-utils/parsers/peggy/qx.js
|
|
517
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/peggy/qx.js
|
|
505
518
|
import * as peggy3 from "peggy";
|
|
506
519
|
var grammars3 = String.raw`
|
|
507
520
|
// global initializer
|
|
@@ -707,7 +720,7 @@ function getParser3() {
|
|
|
707
720
|
return parser3;
|
|
708
721
|
}
|
|
709
722
|
|
|
710
|
-
// src/core/proxy-utils/parsers/peggy/trojan-uri.js
|
|
723
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/peggy/trojan-uri.js
|
|
711
724
|
import * as peggy4 from "peggy";
|
|
712
725
|
var grammars4 = String.raw`
|
|
713
726
|
// global initializer
|
|
@@ -850,7 +863,7 @@ function getParser4() {
|
|
|
850
863
|
return parser4;
|
|
851
864
|
}
|
|
852
865
|
|
|
853
|
-
// src/core/proxy-utils/parsers/index.js
|
|
866
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/index.js
|
|
854
867
|
import { Base64 } from "js-base64";
|
|
855
868
|
function surge_port_hopping(raw) {
|
|
856
869
|
const [parts, port_hopping] = raw.match(
|
|
@@ -914,8 +927,7 @@ function URI_SS() {
|
|
|
914
927
|
const params = {};
|
|
915
928
|
for (const item of pluginInfo) {
|
|
916
929
|
const [key, val] = item.split("=");
|
|
917
|
-
if (key)
|
|
918
|
-
params[key] = val || true;
|
|
930
|
+
if (key) params[key] = val || true;
|
|
919
931
|
}
|
|
920
932
|
switch (params.plugin) {
|
|
921
933
|
case "obfs-local":
|
|
@@ -1098,7 +1110,7 @@ function URI_VMess() {
|
|
|
1098
1110
|
params.allowInsecure
|
|
1099
1111
|
);
|
|
1100
1112
|
}
|
|
1101
|
-
if (proxy.tls &&
|
|
1113
|
+
if (proxy.tls && params.sni && params.sni !== "") {
|
|
1102
1114
|
proxy.sni = params.sni;
|
|
1103
1115
|
}
|
|
1104
1116
|
let httpupgrade = false;
|
|
@@ -1156,9 +1168,6 @@ function URI_VMess() {
|
|
|
1156
1168
|
} else {
|
|
1157
1169
|
delete proxy.network;
|
|
1158
1170
|
}
|
|
1159
|
-
if (proxy.tls && !proxy.sni && transportHost) {
|
|
1160
|
-
proxy.sni = transportHost;
|
|
1161
|
-
}
|
|
1162
1171
|
}
|
|
1163
1172
|
return proxy;
|
|
1164
1173
|
}
|
|
@@ -1282,13 +1291,11 @@ function URI_VLESS() {
|
|
|
1282
1291
|
if (Object.keys(opts).length > 0) {
|
|
1283
1292
|
proxy[`${proxy.network}-opts`] = opts;
|
|
1284
1293
|
}
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
let httpHost = proxy["http-opts"]?.headers?.Host;
|
|
1291
|
-
proxy.sni = Array.isArray(httpHost) ? httpHost[0] : httpHost;
|
|
1294
|
+
if (proxy.network === "kcp") {
|
|
1295
|
+
if (params.seed) {
|
|
1296
|
+
proxy.seed = params.seed;
|
|
1297
|
+
}
|
|
1298
|
+
proxy.headerType = params.headerType || "none";
|
|
1292
1299
|
}
|
|
1293
1300
|
}
|
|
1294
1301
|
return proxy;
|
|
@@ -1597,14 +1604,6 @@ function Clash_All() {
|
|
|
1597
1604
|
if (["vmess", "vless"].includes(proxy.type)) {
|
|
1598
1605
|
proxy.sni = proxy.servername;
|
|
1599
1606
|
delete proxy.servername;
|
|
1600
|
-
if (proxy.tls && !proxy.sni) {
|
|
1601
|
-
if (proxy.network === "ws") {
|
|
1602
|
-
proxy.sni = proxy["ws-opts"]?.headers?.Host;
|
|
1603
|
-
} else if (proxy.network === "http") {
|
|
1604
|
-
let httpHost = proxy["http-opts"]?.headers?.Host;
|
|
1605
|
-
proxy.sni = Array.isArray(httpHost) ? httpHost[0] : httpHost;
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
1607
|
}
|
|
1609
1608
|
if (proxy["server-cert-fingerprint"]) {
|
|
1610
1609
|
proxy["tls-fingerprint"] = proxy["server-cert-fingerprint"];
|
|
@@ -2041,7 +2040,13 @@ var parsers_default = [
|
|
|
2041
2040
|
QX_Socks5()
|
|
2042
2041
|
];
|
|
2043
2042
|
|
|
2044
|
-
// src/core/proxy-utils/producers/
|
|
2043
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/index.js
|
|
2044
|
+
var producers_exports = {};
|
|
2045
|
+
__export(producers_exports, {
|
|
2046
|
+
default: () => producers_default
|
|
2047
|
+
});
|
|
2048
|
+
|
|
2049
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/utils.js
|
|
2045
2050
|
import _ from "lodash";
|
|
2046
2051
|
var Result = class {
|
|
2047
2052
|
constructor(proxy) {
|
|
@@ -2068,16 +2073,14 @@ function isPresent2(obj, attr) {
|
|
|
2068
2073
|
return typeof data !== "undefined" && data !== null;
|
|
2069
2074
|
}
|
|
2070
2075
|
|
|
2071
|
-
// src/
|
|
2072
|
-
var app_default = new Proxy(
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
console.log(`[${property}]`, ...args);
|
|
2076
|
-
};
|
|
2076
|
+
// src/core/app/index.js
|
|
2077
|
+
var app_default = new Proxy(target, {
|
|
2078
|
+
apply: function(target2, thisArg, argumentsList) {
|
|
2079
|
+
console.log(`Function called with arguments: ${argumentsList.join(", ")}`);
|
|
2077
2080
|
}
|
|
2078
2081
|
});
|
|
2079
2082
|
|
|
2080
|
-
// src/core/proxy-utils/producers/surge.js
|
|
2083
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/surge.js
|
|
2081
2084
|
var targetPlatform = "Surge";
|
|
2082
2085
|
var ipVersions = {
|
|
2083
2086
|
dual: "dual",
|
|
@@ -2094,7 +2097,7 @@ function Surge_Producer() {
|
|
|
2094
2097
|
}
|
|
2095
2098
|
switch (proxy.type) {
|
|
2096
2099
|
case "ss":
|
|
2097
|
-
return shadowsocks(proxy);
|
|
2100
|
+
return shadowsocks(proxy, opts["include-unsupported-proxy"]);
|
|
2098
2101
|
case "trojan":
|
|
2099
2102
|
return trojan(proxy);
|
|
2100
2103
|
case "vmess":
|
|
@@ -2123,7 +2126,7 @@ function Surge_Producer() {
|
|
|
2123
2126
|
};
|
|
2124
2127
|
return { produce };
|
|
2125
2128
|
}
|
|
2126
|
-
function shadowsocks(proxy) {
|
|
2129
|
+
function shadowsocks(proxy, includeUnsupportedProxy) {
|
|
2127
2130
|
const result = new Result(proxy);
|
|
2128
2131
|
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
|
|
2129
2132
|
if (!proxy.cipher) {
|
|
@@ -2155,7 +2158,8 @@ function shadowsocks(proxy) {
|
|
|
2155
2158
|
"salsa20",
|
|
2156
2159
|
"chacha20",
|
|
2157
2160
|
"chacha20-ietf",
|
|
2158
|
-
"none"
|
|
2161
|
+
"none",
|
|
2162
|
+
...includeUnsupportedProxy ? ["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm"] : []
|
|
2159
2163
|
].includes(proxy.cipher)) {
|
|
2160
2164
|
throw new Error(`cipher ${proxy.cipher} is not supported`);
|
|
2161
2165
|
}
|
|
@@ -2184,6 +2188,7 @@ function shadowsocks(proxy) {
|
|
|
2184
2188
|
}
|
|
2185
2189
|
result.appendIfPresent(`,tfo=${proxy.tfo}`, "tfo");
|
|
2186
2190
|
result.appendIfPresent(`,udp-relay=${proxy.udp}`, "udp");
|
|
2191
|
+
result.appendIfPresent(`,udp-port=${proxy["udp-port"]}`, "udp-port");
|
|
2187
2192
|
result.appendIfPresent(`,test-url=${proxy["test-url"]}`, "test-url");
|
|
2188
2193
|
result.appendIfPresent(
|
|
2189
2194
|
`,test-timeout=${proxy["test-timeout"]}`,
|
|
@@ -2908,16 +2913,15 @@ function handleTransport(result, proxy, includeUnsupportedProxy) {
|
|
|
2908
2913
|
}
|
|
2909
2914
|
}
|
|
2910
2915
|
|
|
2911
|
-
// src/core/proxy-utils/producers/surgemac.js
|
|
2916
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/surgemac.js
|
|
2912
2917
|
import { Base64 as Base642 } from "js-base64";
|
|
2913
2918
|
|
|
2914
|
-
// src/core/proxy-utils/producers/clashmeta.js
|
|
2919
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/clashmeta.js
|
|
2915
2920
|
function ClashMeta_Producer() {
|
|
2916
2921
|
const type = "ALL";
|
|
2917
2922
|
const produce = (proxies, type2, opts = {}) => {
|
|
2918
2923
|
const list = proxies.filter((proxy) => {
|
|
2919
|
-
if (opts["include-unsupported-proxy"])
|
|
2920
|
-
return true;
|
|
2924
|
+
if (opts["include-unsupported-proxy"]) return true;
|
|
2921
2925
|
if (proxy.type === "snell" && String(proxy.version) === "4") {
|
|
2922
2926
|
return false;
|
|
2923
2927
|
}
|
|
@@ -3051,7 +3055,7 @@ function ClashMeta_Producer() {
|
|
|
3051
3055
|
return { type, produce };
|
|
3052
3056
|
}
|
|
3053
3057
|
|
|
3054
|
-
// src/core/proxy-utils/producers/surgemac.js
|
|
3058
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/surgemac.js
|
|
3055
3059
|
var targetPlatform2 = "SurgeMac";
|
|
3056
3060
|
var surge_Producer = Surge_Producer();
|
|
3057
3061
|
function SurgeMac_Producer() {
|
|
@@ -3059,14 +3063,22 @@ function SurgeMac_Producer() {
|
|
|
3059
3063
|
switch (proxy.type) {
|
|
3060
3064
|
case "external":
|
|
3061
3065
|
return external(proxy);
|
|
3066
|
+
// case 'ssr':
|
|
3067
|
+
// return shadowsocksr(proxy);
|
|
3062
3068
|
default: {
|
|
3063
3069
|
try {
|
|
3064
3070
|
return surge_Producer.produce(proxy, type, opts);
|
|
3065
3071
|
} catch (e) {
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3072
|
+
if (opts.useMihomoExternal) {
|
|
3073
|
+
app_default.log(
|
|
3074
|
+
`${proxy.name} is not supported on ${targetPlatform2}, try to use Mihomo(SurgeMac - External Proxy Program) instead`
|
|
3075
|
+
);
|
|
3076
|
+
return mihomo(proxy, type, opts);
|
|
3077
|
+
} else {
|
|
3078
|
+
throw new Error(
|
|
3079
|
+
`Surge for macOS \u53EF\u624B\u52A8\u6307\u5B9A\u94FE\u63A5\u53C2\u6570 target=SurgeMac \u6216\u5728 \u540C\u6B65\u914D\u7F6E \u4E2D\u6307\u5B9A SurgeMac \u6765\u542F\u7528 mihomo \u652F\u63F4 Surge \u672C\u8EAB\u4E0D\u652F\u6301\u7684\u534F\u8BAE`
|
|
3080
|
+
);
|
|
3081
|
+
}
|
|
3070
3082
|
}
|
|
3071
3083
|
}
|
|
3072
3084
|
}
|
|
@@ -3162,13 +3174,12 @@ function isIP2(ip) {
|
|
|
3162
3174
|
return isIPv4(ip) || isIPv6(ip);
|
|
3163
3175
|
}
|
|
3164
3176
|
|
|
3165
|
-
// src/core/proxy-utils/producers/clash.js
|
|
3177
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/clash.js
|
|
3166
3178
|
function Clash_Producer() {
|
|
3167
3179
|
const type = "ALL";
|
|
3168
3180
|
const produce = (proxies, type2, opts = {}) => {
|
|
3169
3181
|
const list = proxies.filter((proxy) => {
|
|
3170
|
-
if (opts["include-unsupported-proxy"])
|
|
3171
|
-
return true;
|
|
3182
|
+
if (opts["include-unsupported-proxy"]) return true;
|
|
3172
3183
|
if (![
|
|
3173
3184
|
"ss",
|
|
3174
3185
|
"ssr",
|
|
@@ -3296,13 +3307,12 @@ function Clash_Producer() {
|
|
|
3296
3307
|
return { type, produce };
|
|
3297
3308
|
}
|
|
3298
3309
|
|
|
3299
|
-
// src/core/proxy-utils/producers/stash.js
|
|
3310
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/stash.js
|
|
3300
3311
|
function Stash_Producer() {
|
|
3301
3312
|
const type = "ALL";
|
|
3302
3313
|
const produce = (proxies, type2, opts = {}) => {
|
|
3303
3314
|
const list = proxies.filter((proxy) => {
|
|
3304
|
-
if (opts["include-unsupported-proxy"])
|
|
3305
|
-
return true;
|
|
3315
|
+
if (opts["include-unsupported-proxy"]) return true;
|
|
3306
3316
|
if (![
|
|
3307
3317
|
"ss",
|
|
3308
3318
|
"ssr",
|
|
@@ -3504,7 +3514,7 @@ function Stash_Producer() {
|
|
|
3504
3514
|
return { type, produce };
|
|
3505
3515
|
}
|
|
3506
3516
|
|
|
3507
|
-
// src/core/proxy-utils/producers/loon.js
|
|
3517
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/loon.js
|
|
3508
3518
|
var targetPlatform3 = "Loon";
|
|
3509
3519
|
function Loon_Producer() {
|
|
3510
3520
|
const produce = (proxy) => {
|
|
@@ -3883,7 +3893,7 @@ function hysteria22(proxy) {
|
|
|
3883
3893
|
return result.toString();
|
|
3884
3894
|
}
|
|
3885
3895
|
|
|
3886
|
-
// src/core/proxy-utils/producers/uri.js
|
|
3896
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/uri.js
|
|
3887
3897
|
import { Base64 as Base643 } from "js-base64";
|
|
3888
3898
|
function URI_Producer() {
|
|
3889
3899
|
const type = "SINGLE";
|
|
@@ -4053,6 +4063,18 @@ function URI_Producer() {
|
|
|
4053
4063
|
vlessTransportServiceName
|
|
4054
4064
|
)}`;
|
|
4055
4065
|
}
|
|
4066
|
+
if (proxy.network === "kcp") {
|
|
4067
|
+
if (proxy.seed) {
|
|
4068
|
+
vlessTransport += `&seed=${encodeURIComponent(
|
|
4069
|
+
proxy.seed
|
|
4070
|
+
)}`;
|
|
4071
|
+
}
|
|
4072
|
+
if (proxy.headerType) {
|
|
4073
|
+
vlessTransport += `&headerType=${encodeURIComponent(
|
|
4074
|
+
proxy.headerType
|
|
4075
|
+
)}`;
|
|
4076
|
+
}
|
|
4077
|
+
}
|
|
4056
4078
|
result = `vless://${proxy.uuid}@${proxy.server}:${proxy.port}?security=${encodeURIComponent(
|
|
4057
4079
|
security
|
|
4058
4080
|
)}${vlessTransport}${alpn}${allowInsecure}${sni}${fp}${flow}${sid}${pbk}#${encodeURIComponent(
|
|
@@ -4269,7 +4291,7 @@ function URI_Producer() {
|
|
|
4269
4291
|
return { type, produce };
|
|
4270
4292
|
}
|
|
4271
4293
|
|
|
4272
|
-
// src/core/proxy-utils/producers/v2ray.js
|
|
4294
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/v2ray.js
|
|
4273
4295
|
import { Base64 as Base644 } from "js-base64";
|
|
4274
4296
|
var URI = URI_Producer();
|
|
4275
4297
|
function V2Ray_Producer() {
|
|
@@ -4295,7 +4317,7 @@ Reason: ${err}`
|
|
|
4295
4317
|
return { type, produce };
|
|
4296
4318
|
}
|
|
4297
4319
|
|
|
4298
|
-
// src/core/proxy-utils/producers/qx.js
|
|
4320
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/qx.js
|
|
4299
4321
|
var targetPlatform4 = "QX";
|
|
4300
4322
|
function QX_Producer() {
|
|
4301
4323
|
const produce = (proxy, type, opts = {}) => {
|
|
@@ -4365,10 +4387,8 @@ function shadowsocks3(proxy) {
|
|
|
4365
4387
|
append(`,obfs=${opts.mode}`);
|
|
4366
4388
|
} else if (proxy.plugin === "v2ray-plugin" && proxy["plugin-opts"].mode === "websocket") {
|
|
4367
4389
|
const opts = proxy["plugin-opts"];
|
|
4368
|
-
if (opts.tls)
|
|
4369
|
-
|
|
4370
|
-
else
|
|
4371
|
-
append(`,obfs=ws`);
|
|
4390
|
+
if (opts.tls) append(`,obfs=wss`);
|
|
4391
|
+
else append(`,obfs=ws`);
|
|
4372
4392
|
} else {
|
|
4373
4393
|
throw new Error(`plugin is not supported`);
|
|
4374
4394
|
}
|
|
@@ -4445,10 +4465,8 @@ function trojan3(proxy) {
|
|
|
4445
4465
|
append(`,password=${proxy.password}`);
|
|
4446
4466
|
if (isPresent2(proxy, "network")) {
|
|
4447
4467
|
if (proxy.network === "ws") {
|
|
4448
|
-
if (needTls(proxy))
|
|
4449
|
-
|
|
4450
|
-
else
|
|
4451
|
-
append(`,obfs=ws`);
|
|
4468
|
+
if (needTls(proxy)) append(`,obfs=wss`);
|
|
4469
|
+
else append(`,obfs=ws`);
|
|
4452
4470
|
appendIfPresent(
|
|
4453
4471
|
`,obfs-uri=${proxy["ws-opts"]?.path}`,
|
|
4454
4472
|
"ws-opts.path"
|
|
@@ -4515,10 +4533,8 @@ function vmess3(proxy) {
|
|
|
4515
4533
|
}
|
|
4516
4534
|
if (isPresent2(proxy, "network")) {
|
|
4517
4535
|
if (proxy.network === "ws") {
|
|
4518
|
-
if (proxy.tls)
|
|
4519
|
-
|
|
4520
|
-
else
|
|
4521
|
-
append(`,obfs=ws`);
|
|
4536
|
+
if (proxy.tls) append(`,obfs=wss`);
|
|
4537
|
+
else append(`,obfs=ws`);
|
|
4522
4538
|
} else if (proxy.network === "http") {
|
|
4523
4539
|
append(`,obfs=http`);
|
|
4524
4540
|
} else {
|
|
@@ -4535,8 +4551,7 @@ function vmess3(proxy) {
|
|
|
4535
4551
|
`${proxy.network}-opts.headers.Host`
|
|
4536
4552
|
);
|
|
4537
4553
|
} else {
|
|
4538
|
-
if (proxy.tls)
|
|
4539
|
-
append(`,obfs=over-tls`);
|
|
4554
|
+
if (proxy.tls) append(`,obfs=over-tls`);
|
|
4540
4555
|
}
|
|
4541
4556
|
if (needTls(proxy)) {
|
|
4542
4557
|
appendIfPresent(
|
|
@@ -4592,10 +4607,8 @@ function vless2(proxy) {
|
|
|
4592
4607
|
}
|
|
4593
4608
|
if (isPresent2(proxy, "network")) {
|
|
4594
4609
|
if (proxy.network === "ws") {
|
|
4595
|
-
if (proxy.tls)
|
|
4596
|
-
|
|
4597
|
-
else
|
|
4598
|
-
append(`,obfs=ws`);
|
|
4610
|
+
if (proxy.tls) append(`,obfs=wss`);
|
|
4611
|
+
else append(`,obfs=ws`);
|
|
4599
4612
|
} else if (proxy.network === "http") {
|
|
4600
4613
|
append(`,obfs=http`);
|
|
4601
4614
|
} else if (!["tcp"].includes(proxy.network)) {
|
|
@@ -4612,8 +4625,7 @@ function vless2(proxy) {
|
|
|
4612
4625
|
`${proxy.network}-opts.headers.Host`
|
|
4613
4626
|
);
|
|
4614
4627
|
} else {
|
|
4615
|
-
if (proxy.tls)
|
|
4616
|
-
append(`,obfs=over-tls`);
|
|
4628
|
+
if (proxy.tls) append(`,obfs=over-tls`);
|
|
4617
4629
|
}
|
|
4618
4630
|
if (needTls(proxy)) {
|
|
4619
4631
|
appendIfPresent(
|
|
@@ -4740,13 +4752,12 @@ function needTls(proxy) {
|
|
|
4740
4752
|
return proxy.tls;
|
|
4741
4753
|
}
|
|
4742
4754
|
|
|
4743
|
-
// src/core/proxy-utils/producers/shadowrocket.js
|
|
4755
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/shadowrocket.js
|
|
4744
4756
|
function ShadowRocket_Producer() {
|
|
4745
4757
|
const type = "ALL";
|
|
4746
4758
|
const produce = (proxies, type2, opts = {}) => {
|
|
4747
4759
|
const list = proxies.filter((proxy) => {
|
|
4748
|
-
if (opts["include-unsupported-proxy"])
|
|
4749
|
-
return true;
|
|
4760
|
+
if (opts["include-unsupported-proxy"]) return true;
|
|
4750
4761
|
if (proxy.type === "snell" && String(proxy.version) === "4") {
|
|
4751
4762
|
return false;
|
|
4752
4763
|
}
|
|
@@ -4884,7 +4895,7 @@ function ShadowRocket_Producer() {
|
|
|
4884
4895
|
return { type, produce };
|
|
4885
4896
|
}
|
|
4886
4897
|
|
|
4887
|
-
// src/core/proxy-utils/producers/surfboard.js
|
|
4898
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/surfboard.js
|
|
4888
4899
|
var targetPlatform5 = "Surfboard";
|
|
4889
4900
|
function Surfboard_Producer() {
|
|
4890
4901
|
const produce = (proxy) => {
|
|
@@ -5056,25 +5067,19 @@ function handleTransport2(result, proxy) {
|
|
|
5056
5067
|
}
|
|
5057
5068
|
}
|
|
5058
5069
|
|
|
5059
|
-
// src/core/proxy-utils/producers/sing-box.js
|
|
5070
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/sing-box.js
|
|
5060
5071
|
var detourParser = (proxy, parsedProxy) => {
|
|
5061
|
-
if (proxy["dialer-proxy"])
|
|
5062
|
-
parsedProxy.detour = proxy["dialer-proxy"];
|
|
5072
|
+
if (proxy["dialer-proxy"]) parsedProxy.detour = proxy["dialer-proxy"];
|
|
5063
5073
|
};
|
|
5064
5074
|
var tfoParser = (proxy, parsedProxy) => {
|
|
5065
5075
|
parsedProxy.tcp_fast_open = false;
|
|
5066
|
-
if (proxy.tfo)
|
|
5067
|
-
|
|
5068
|
-
if (proxy.tcp_fast_open
|
|
5069
|
-
|
|
5070
|
-
if (proxy["tcp-fast-open"])
|
|
5071
|
-
parsedProxy.tcp_fast_open = true;
|
|
5072
|
-
if (!parsedProxy.tcp_fast_open)
|
|
5073
|
-
delete parsedProxy.tcp_fast_open;
|
|
5076
|
+
if (proxy.tfo) parsedProxy.tcp_fast_open = true;
|
|
5077
|
+
if (proxy.tcp_fast_open) parsedProxy.tcp_fast_open = true;
|
|
5078
|
+
if (proxy["tcp-fast-open"]) parsedProxy.tcp_fast_open = true;
|
|
5079
|
+
if (!parsedProxy.tcp_fast_open) delete parsedProxy.tcp_fast_open;
|
|
5074
5080
|
};
|
|
5075
5081
|
var smuxParser = (smux, proxy) => {
|
|
5076
|
-
if (!smux || !smux.enabled)
|
|
5077
|
-
return;
|
|
5082
|
+
if (!smux || !smux.enabled) return;
|
|
5078
5083
|
proxy.multiplex = { enabled: true };
|
|
5079
5084
|
proxy.multiplex.protocol = smux.protocol;
|
|
5080
5085
|
if (smux["max-connections"])
|
|
@@ -5086,32 +5091,26 @@ var smuxParser = (smux, proxy) => {
|
|
|
5086
5091
|
proxy.multiplex.max_streams = parseInt(`${smux["max-streams"]}`, 10);
|
|
5087
5092
|
if (smux["min-streams"])
|
|
5088
5093
|
proxy.multiplex.min_streams = parseInt(`${smux["min-streams"]}`, 10);
|
|
5089
|
-
if (smux.padding)
|
|
5090
|
-
proxy.multiplex.padding = true;
|
|
5094
|
+
if (smux.padding) proxy.multiplex.padding = true;
|
|
5091
5095
|
};
|
|
5092
5096
|
var wsParser = (proxy, parsedProxy) => {
|
|
5093
5097
|
const transport = { type: "ws", headers: {} };
|
|
5094
5098
|
if (proxy["ws-opts"]) {
|
|
5095
5099
|
const { path: wsPath = "", headers: wsHeaders = {} } = proxy["ws-opts"];
|
|
5096
|
-
if (wsPath !== "")
|
|
5097
|
-
transport.path = `${wsPath}`;
|
|
5100
|
+
if (wsPath !== "") transport.path = `${wsPath}`;
|
|
5098
5101
|
if (Object.keys(wsHeaders).length > 0) {
|
|
5099
5102
|
const headers = {};
|
|
5100
5103
|
for (const key of Object.keys(wsHeaders)) {
|
|
5101
5104
|
let value = wsHeaders[key];
|
|
5102
|
-
if (value === "")
|
|
5103
|
-
|
|
5104
|
-
if (
|
|
5105
|
-
value = [`${value}`];
|
|
5106
|
-
if (value.length > 0)
|
|
5107
|
-
headers[key] = value;
|
|
5105
|
+
if (value === "") continue;
|
|
5106
|
+
if (!Array.isArray(value)) value = [`${value}`];
|
|
5107
|
+
if (value.length > 0) headers[key] = value;
|
|
5108
5108
|
}
|
|
5109
5109
|
const { Host: wsHost } = headers;
|
|
5110
5110
|
if (wsHost.length === 1)
|
|
5111
5111
|
for (const item of `Host:${wsHost[0]}`.split("\n")) {
|
|
5112
5112
|
const [key, value] = item.split(":");
|
|
5113
|
-
if (value.trim() === "")
|
|
5114
|
-
continue;
|
|
5113
|
+
if (value.trim() === "") continue;
|
|
5115
5114
|
headers[key.trim()] = value.trim().split(",");
|
|
5116
5115
|
}
|
|
5117
5116
|
transport.headers = headers;
|
|
@@ -5121,19 +5120,15 @@ var wsParser = (proxy, parsedProxy) => {
|
|
|
5121
5120
|
const headers = {};
|
|
5122
5121
|
for (const key of Object.keys(proxy["ws-headers"])) {
|
|
5123
5122
|
let value = proxy["ws-headers"][key];
|
|
5124
|
-
if (value === "")
|
|
5125
|
-
|
|
5126
|
-
if (
|
|
5127
|
-
value = [`${value}`];
|
|
5128
|
-
if (value.length > 0)
|
|
5129
|
-
headers[key] = value;
|
|
5123
|
+
if (value === "") continue;
|
|
5124
|
+
if (!Array.isArray(value)) value = [`${value}`];
|
|
5125
|
+
if (value.length > 0) headers[key] = value;
|
|
5130
5126
|
}
|
|
5131
5127
|
const { Host: wsHost } = headers;
|
|
5132
5128
|
if (wsHost.length === 1)
|
|
5133
5129
|
for (const item of `Host:${wsHost[0]}`.split("\n")) {
|
|
5134
5130
|
const [key, value] = item.split(":");
|
|
5135
|
-
if (value.trim() === "")
|
|
5136
|
-
continue;
|
|
5131
|
+
if (value.trim() === "") continue;
|
|
5137
5132
|
headers[key.trim()] = value.trim().split(",");
|
|
5138
5133
|
}
|
|
5139
5134
|
for (const key of Object.keys(headers))
|
|
@@ -5158,15 +5153,13 @@ var wsParser = (proxy, parsedProxy) => {
|
|
|
5158
5153
|
transport.host = transport.headers.Host[0];
|
|
5159
5154
|
delete transport.headers.Host;
|
|
5160
5155
|
}
|
|
5161
|
-
if (transport.max_early_data)
|
|
5162
|
-
delete transport.max_early_data;
|
|
5156
|
+
if (transport.max_early_data) delete transport.max_early_data;
|
|
5163
5157
|
if (transport.early_data_header_name)
|
|
5164
5158
|
delete transport.early_data_header_name;
|
|
5165
5159
|
}
|
|
5166
5160
|
for (const key of Object.keys(transport.headers)) {
|
|
5167
5161
|
const value = transport.headers[key];
|
|
5168
|
-
if (value.length === 1)
|
|
5169
|
-
transport.headers[key] = value[0];
|
|
5162
|
+
if (value.length === 1) transport.headers[key] = value[0];
|
|
5170
5163
|
}
|
|
5171
5164
|
parsedProxy.transport = transport;
|
|
5172
5165
|
};
|
|
@@ -5178,54 +5171,44 @@ var h1Parser = (proxy, parsedProxy) => {
|
|
|
5178
5171
|
path: h1Path = "",
|
|
5179
5172
|
headers: h1Headers = {}
|
|
5180
5173
|
} = proxy["http-opts"];
|
|
5181
|
-
if (method !== "")
|
|
5182
|
-
transport.method = method;
|
|
5174
|
+
if (method !== "") transport.method = method;
|
|
5183
5175
|
if (Array.isArray(h1Path)) {
|
|
5184
5176
|
transport.path = `${h1Path[0]}`;
|
|
5185
|
-
} else if (h1Path !== "")
|
|
5186
|
-
transport.path = `${h1Path}`;
|
|
5177
|
+
} else if (h1Path !== "") transport.path = `${h1Path}`;
|
|
5187
5178
|
for (const key of Object.keys(h1Headers)) {
|
|
5188
5179
|
let value = h1Headers[key];
|
|
5189
|
-
if (value === "")
|
|
5190
|
-
continue;
|
|
5180
|
+
if (value === "") continue;
|
|
5191
5181
|
if (key.toLowerCase() === "host") {
|
|
5192
5182
|
let host = value;
|
|
5193
5183
|
if (!Array.isArray(host))
|
|
5194
5184
|
host = `${host}`.split(",").map((i) => i.trim());
|
|
5195
|
-
if (host.length > 0)
|
|
5196
|
-
transport.host = host;
|
|
5185
|
+
if (host.length > 0) transport.host = host;
|
|
5197
5186
|
continue;
|
|
5198
5187
|
}
|
|
5199
5188
|
if (!Array.isArray(value))
|
|
5200
5189
|
value = `${value}`.split(",").map((i) => i.trim());
|
|
5201
|
-
if (value.length > 0)
|
|
5202
|
-
transport.headers[key] = value;
|
|
5190
|
+
if (value.length > 0) transport.headers[key] = value;
|
|
5203
5191
|
}
|
|
5204
5192
|
}
|
|
5205
5193
|
if (proxy["http-host"] && proxy["http-host"] !== "") {
|
|
5206
5194
|
let host = proxy["http-host"];
|
|
5207
5195
|
if (!Array.isArray(host))
|
|
5208
5196
|
host = `${host}`.split(",").map((i) => i.trim());
|
|
5209
|
-
if (host.length > 0)
|
|
5210
|
-
transport.host = host;
|
|
5197
|
+
if (host.length > 0) transport.host = host;
|
|
5211
5198
|
}
|
|
5212
|
-
if (!transport.host)
|
|
5213
|
-
return;
|
|
5199
|
+
if (!transport.host) return;
|
|
5214
5200
|
if (proxy["http-path"] && proxy["http-path"] !== "") {
|
|
5215
5201
|
const path = proxy["http-path"];
|
|
5216
5202
|
if (Array.isArray(path)) {
|
|
5217
5203
|
transport.path = `${path[0]}`;
|
|
5218
|
-
} else if (path !== "")
|
|
5219
|
-
transport.path = `${path}`;
|
|
5204
|
+
} else if (path !== "") transport.path = `${path}`;
|
|
5220
5205
|
}
|
|
5221
5206
|
if (parsedProxy.tls.insecure)
|
|
5222
5207
|
parsedProxy.tls.server_name = transport.host[0];
|
|
5223
|
-
if (transport.host.length === 1)
|
|
5224
|
-
transport.host = transport.host[0];
|
|
5208
|
+
if (transport.host.length === 1) transport.host = transport.host[0];
|
|
5225
5209
|
for (const key of Object.keys(transport.headers)) {
|
|
5226
5210
|
const value = transport.headers[key];
|
|
5227
|
-
if (value.length === 1)
|
|
5228
|
-
transport.headers[key] = value[0];
|
|
5211
|
+
if (value.length === 1) transport.headers[key] = value[0];
|
|
5229
5212
|
}
|
|
5230
5213
|
parsedProxy.transport = transport;
|
|
5231
5214
|
};
|
|
@@ -5233,29 +5216,25 @@ var h2Parser = (proxy, parsedProxy) => {
|
|
|
5233
5216
|
const transport = { type: "http" };
|
|
5234
5217
|
if (proxy["h2-opts"]) {
|
|
5235
5218
|
let { host = "", path = "" } = proxy["h2-opts"];
|
|
5236
|
-
if (path !== "")
|
|
5237
|
-
transport.path = `${path}`;
|
|
5219
|
+
if (path !== "") transport.path = `${path}`;
|
|
5238
5220
|
if (host !== "") {
|
|
5239
5221
|
if (!Array.isArray(host))
|
|
5240
5222
|
host = `${host}`.split(",").map((i) => i.trim());
|
|
5241
|
-
if (host.length > 0)
|
|
5242
|
-
transport.host = host;
|
|
5223
|
+
if (host.length > 0) transport.host = host;
|
|
5243
5224
|
}
|
|
5244
5225
|
}
|
|
5245
5226
|
if (proxy["h2-host"] && proxy["h2-host"] !== "") {
|
|
5246
5227
|
let host = proxy["h2-host"];
|
|
5247
5228
|
if (!Array.isArray(host))
|
|
5248
5229
|
host = `${host}`.split(",").map((i) => i.trim());
|
|
5249
|
-
if (host.length > 0)
|
|
5250
|
-
transport.host = host;
|
|
5230
|
+
if (host.length > 0) transport.host = host;
|
|
5251
5231
|
}
|
|
5252
5232
|
if (proxy["h2-path"] && proxy["h2-path"] !== "")
|
|
5253
5233
|
transport.path = `${proxy["h2-path"]}`;
|
|
5254
5234
|
parsedProxy.tls.enabled = true;
|
|
5255
5235
|
if (parsedProxy.tls.insecure)
|
|
5256
5236
|
parsedProxy.tls.server_name = transport.host[0];
|
|
5257
|
-
if (transport.host.length === 1)
|
|
5258
|
-
transport.host = transport.host[0];
|
|
5237
|
+
if (transport.host.length === 1) transport.host = transport.host[0];
|
|
5259
5238
|
parsedProxy.transport = transport;
|
|
5260
5239
|
};
|
|
5261
5240
|
var grpcParser = (proxy, parsedProxy) => {
|
|
@@ -5268,30 +5247,21 @@ var grpcParser = (proxy, parsedProxy) => {
|
|
|
5268
5247
|
parsedProxy.transport = transport;
|
|
5269
5248
|
};
|
|
5270
5249
|
var tlsParser = (proxy, parsedProxy) => {
|
|
5271
|
-
if (proxy.tls)
|
|
5272
|
-
parsedProxy.tls.enabled = true;
|
|
5250
|
+
if (proxy.tls) parsedProxy.tls.enabled = true;
|
|
5273
5251
|
if (proxy.servername && proxy.servername !== "")
|
|
5274
5252
|
parsedProxy.tls.server_name = proxy.servername;
|
|
5275
5253
|
if (proxy.peer && proxy.peer !== "")
|
|
5276
5254
|
parsedProxy.tls.server_name = proxy.peer;
|
|
5277
|
-
if (proxy.sni && proxy.sni !== "")
|
|
5278
|
-
|
|
5279
|
-
if (proxy
|
|
5280
|
-
|
|
5281
|
-
if (proxy.insecure)
|
|
5282
|
-
parsedProxy.tls.insecure = true;
|
|
5283
|
-
if (proxy["disable-sni"])
|
|
5284
|
-
parsedProxy.tls.disable_sni = true;
|
|
5255
|
+
if (proxy.sni && proxy.sni !== "") parsedProxy.tls.server_name = proxy.sni;
|
|
5256
|
+
if (proxy["skip-cert-verify"]) parsedProxy.tls.insecure = true;
|
|
5257
|
+
if (proxy.insecure) parsedProxy.tls.insecure = true;
|
|
5258
|
+
if (proxy["disable-sni"]) parsedProxy.tls.disable_sni = true;
|
|
5285
5259
|
if (typeof proxy.alpn === "string") {
|
|
5286
5260
|
parsedProxy.tls.alpn = [proxy.alpn];
|
|
5287
|
-
} else if (Array.isArray(proxy.alpn))
|
|
5288
|
-
|
|
5289
|
-
if (proxy.
|
|
5290
|
-
|
|
5291
|
-
if (proxy.ca_str)
|
|
5292
|
-
parsedProxy.tls.certificate = [proxy.ca_str];
|
|
5293
|
-
if (proxy["ca-str"])
|
|
5294
|
-
parsedProxy.tls.certificate = [proxy["ca-str"]];
|
|
5261
|
+
} else if (Array.isArray(proxy.alpn)) parsedProxy.tls.alpn = proxy.alpn;
|
|
5262
|
+
if (proxy.ca) parsedProxy.tls.certificate_path = `${proxy.ca}`;
|
|
5263
|
+
if (proxy.ca_str) parsedProxy.tls.certificate = [proxy.ca_str];
|
|
5264
|
+
if (proxy["ca-str"]) parsedProxy.tls.certificate = [proxy["ca-str"]];
|
|
5295
5265
|
if (proxy["reality-opts"]) {
|
|
5296
5266
|
parsedProxy.tls.reality = { enabled: true };
|
|
5297
5267
|
if (proxy["reality-opts"]["public-key"])
|
|
@@ -5305,8 +5275,7 @@ var tlsParser = (proxy, parsedProxy) => {
|
|
|
5305
5275
|
enabled: true,
|
|
5306
5276
|
fingerprint: proxy["client-fingerprint"]
|
|
5307
5277
|
};
|
|
5308
|
-
if (!parsedProxy.tls.enabled)
|
|
5309
|
-
delete parsedProxy.tls;
|
|
5278
|
+
if (!parsedProxy.tls.enabled) delete parsedProxy.tls;
|
|
5310
5279
|
};
|
|
5311
5280
|
var sshParser = (proxy = {}) => {
|
|
5312
5281
|
const parsedProxy = {
|
|
@@ -5317,12 +5286,9 @@ var sshParser = (proxy = {}) => {
|
|
|
5317
5286
|
};
|
|
5318
5287
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5319
5288
|
throw "invalid port";
|
|
5320
|
-
if (proxy.username)
|
|
5321
|
-
|
|
5322
|
-
if (proxy.
|
|
5323
|
-
parsedProxy.password = proxy.password;
|
|
5324
|
-
if (proxy["privateKey"])
|
|
5325
|
-
parsedProxy.private_key_path = proxy["privateKey"];
|
|
5289
|
+
if (proxy.username) parsedProxy.user = proxy.username;
|
|
5290
|
+
if (proxy.password) parsedProxy.password = proxy.password;
|
|
5291
|
+
if (proxy["privateKey"]) parsedProxy.private_key_path = proxy["privateKey"];
|
|
5326
5292
|
if (proxy["private-key"])
|
|
5327
5293
|
parsedProxy.private_key_path = proxy["private-key"];
|
|
5328
5294
|
if (proxy["private-key-passphrase"])
|
|
@@ -5333,12 +5299,10 @@ var sshParser = (proxy = {}) => {
|
|
|
5333
5299
|
proxy["server-fingerprint"].split(" ")[0]
|
|
5334
5300
|
];
|
|
5335
5301
|
}
|
|
5336
|
-
if (proxy["host-key"])
|
|
5337
|
-
parsedProxy.host_key = proxy["host-key"];
|
|
5302
|
+
if (proxy["host-key"]) parsedProxy.host_key = proxy["host-key"];
|
|
5338
5303
|
if (proxy["host-key-algorithms"])
|
|
5339
5304
|
parsedProxy.host_key_algorithms = proxy["host-key-algorithms"];
|
|
5340
|
-
if (proxy["fast-open"])
|
|
5341
|
-
parsedProxy.udp_fragment = true;
|
|
5305
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5342
5306
|
tfoParser(proxy, parsedProxy);
|
|
5343
5307
|
detourParser(proxy, parsedProxy);
|
|
5344
5308
|
return parsedProxy;
|
|
@@ -5353,10 +5317,8 @@ var httpParser = (proxy = {}) => {
|
|
|
5353
5317
|
};
|
|
5354
5318
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5355
5319
|
throw "invalid port";
|
|
5356
|
-
if (proxy.username)
|
|
5357
|
-
|
|
5358
|
-
if (proxy.password)
|
|
5359
|
-
parsedProxy.password = proxy.password;
|
|
5320
|
+
if (proxy.username) parsedProxy.username = proxy.username;
|
|
5321
|
+
if (proxy.password) parsedProxy.password = proxy.password;
|
|
5360
5322
|
if (proxy.headers) {
|
|
5361
5323
|
parsedProxy.headers = {};
|
|
5362
5324
|
for (const k of Object.keys(proxy.headers)) {
|
|
@@ -5365,8 +5327,7 @@ var httpParser = (proxy = {}) => {
|
|
|
5365
5327
|
if (Object.keys(parsedProxy.headers).length === 0)
|
|
5366
5328
|
delete parsedProxy.headers;
|
|
5367
5329
|
}
|
|
5368
|
-
if (proxy["fast-open"])
|
|
5369
|
-
parsedProxy.udp_fragment = true;
|
|
5330
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5370
5331
|
tfoParser(proxy, parsedProxy);
|
|
5371
5332
|
detourParser(proxy, parsedProxy);
|
|
5372
5333
|
tlsParser(proxy, parsedProxy);
|
|
@@ -5383,16 +5344,11 @@ var socks5Parser = (proxy = {}) => {
|
|
|
5383
5344
|
};
|
|
5384
5345
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5385
5346
|
throw "invalid port";
|
|
5386
|
-
if (proxy.username)
|
|
5387
|
-
|
|
5388
|
-
if (proxy.
|
|
5389
|
-
|
|
5390
|
-
if (proxy.
|
|
5391
|
-
parsedProxy.udp_over_tcp = true;
|
|
5392
|
-
if (proxy["udp-over-tcp"])
|
|
5393
|
-
parsedProxy.udp_over_tcp = true;
|
|
5394
|
-
if (proxy["fast-open"])
|
|
5395
|
-
parsedProxy.udp_fragment = true;
|
|
5347
|
+
if (proxy.username) parsedProxy.username = proxy.username;
|
|
5348
|
+
if (proxy.password) parsedProxy.password = proxy.password;
|
|
5349
|
+
if (proxy.uot) parsedProxy.udp_over_tcp = true;
|
|
5350
|
+
if (proxy["udp-over-tcp"]) parsedProxy.udp_over_tcp = true;
|
|
5351
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5396
5352
|
tfoParser(proxy, parsedProxy);
|
|
5397
5353
|
detourParser(proxy, parsedProxy);
|
|
5398
5354
|
return parsedProxy;
|
|
@@ -5423,8 +5379,7 @@ var shadowTLSParser = (proxy = {}) => {
|
|
|
5423
5379
|
};
|
|
5424
5380
|
if (stPart.server_port < 0 || stPart.server_port > 65535)
|
|
5425
5381
|
throw "\u7AEF\u53E3\u503C\u975E\u6CD5";
|
|
5426
|
-
if (proxy["fast-open"] === true)
|
|
5427
|
-
stPart.udp_fragment = true;
|
|
5382
|
+
if (proxy["fast-open"] === true) stPart.udp_fragment = true;
|
|
5428
5383
|
tfoParser(proxy, stPart);
|
|
5429
5384
|
detourParser(proxy, stPart);
|
|
5430
5385
|
smuxParser(proxy.smux, ssPart);
|
|
@@ -5441,12 +5396,9 @@ var ssParser = (proxy = {}) => {
|
|
|
5441
5396
|
};
|
|
5442
5397
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5443
5398
|
throw "invalid port";
|
|
5444
|
-
if (proxy.uot)
|
|
5445
|
-
|
|
5446
|
-
if (proxy["
|
|
5447
|
-
parsedProxy.udp_over_tcp = true;
|
|
5448
|
-
if (proxy["fast-open"])
|
|
5449
|
-
parsedProxy.udp_fragment = true;
|
|
5399
|
+
if (proxy.uot) parsedProxy.udp_over_tcp = true;
|
|
5400
|
+
if (proxy["udp-over-tcp"]) parsedProxy.udp_over_tcp = true;
|
|
5401
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5450
5402
|
tfoParser(proxy, parsedProxy);
|
|
5451
5403
|
detourParser(proxy, parsedProxy);
|
|
5452
5404
|
smuxParser(proxy.smux, parsedProxy);
|
|
@@ -5473,15 +5425,12 @@ var ssParser = (proxy = {}) => {
|
|
|
5473
5425
|
}
|
|
5474
5426
|
if (proxy.plugin === "v2ray-plugin") {
|
|
5475
5427
|
parsedProxy.plugin = "v2ray-plugin";
|
|
5476
|
-
if (proxy["ws-host"])
|
|
5477
|
-
|
|
5478
|
-
if (proxy["ws-path"])
|
|
5479
|
-
proxy["plugin-opts"].path = proxy["ws-path"];
|
|
5428
|
+
if (proxy["ws-host"]) proxy["plugin-opts"].host = proxy["ws-host"];
|
|
5429
|
+
if (proxy["ws-path"]) proxy["plugin-opts"].path = proxy["ws-path"];
|
|
5480
5430
|
Object.keys(proxy["plugin-opts"]).forEach((k) => {
|
|
5481
5431
|
switch (k) {
|
|
5482
5432
|
case "tls":
|
|
5483
|
-
if (proxy["plugin-opts"].tls)
|
|
5484
|
-
optArr.push("tls");
|
|
5433
|
+
if (proxy["plugin-opts"].tls) optArr.push("tls");
|
|
5485
5434
|
break;
|
|
5486
5435
|
case "host":
|
|
5487
5436
|
optArr.push(`host=${proxy["plugin-opts"].host}`);
|
|
@@ -5522,12 +5471,10 @@ var ssrParser = (proxy = {}) => {
|
|
|
5522
5471
|
};
|
|
5523
5472
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5524
5473
|
throw "invalid port";
|
|
5525
|
-
if (proxy["obfs-param"])
|
|
5526
|
-
parsedProxy.obfs_param = proxy["obfs-param"];
|
|
5474
|
+
if (proxy["obfs-param"]) parsedProxy.obfs_param = proxy["obfs-param"];
|
|
5527
5475
|
if (proxy["protocol-param"] && proxy["protocol-param"] !== "")
|
|
5528
5476
|
parsedProxy.protocol_param = proxy["protocol-param"];
|
|
5529
|
-
if (proxy["fast-open"])
|
|
5530
|
-
parsedProxy.udp_fragment = true;
|
|
5477
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5531
5478
|
tfoParser(proxy, parsedProxy);
|
|
5532
5479
|
detourParser(proxy, parsedProxy);
|
|
5533
5480
|
smuxParser(proxy.smux, parsedProxy);
|
|
@@ -5555,18 +5502,12 @@ var vmessParser = (proxy = {}) => {
|
|
|
5555
5502
|
parsedProxy.security = "auto";
|
|
5556
5503
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5557
5504
|
throw "invalid port";
|
|
5558
|
-
if (proxy.xudp)
|
|
5559
|
-
|
|
5560
|
-
if (proxy
|
|
5561
|
-
|
|
5562
|
-
if (proxy.network === "
|
|
5563
|
-
|
|
5564
|
-
if (proxy.network === "h2")
|
|
5565
|
-
h2Parser(proxy, parsedProxy);
|
|
5566
|
-
if (proxy.network === "http")
|
|
5567
|
-
h1Parser(proxy, parsedProxy);
|
|
5568
|
-
if (proxy.network === "grpc")
|
|
5569
|
-
grpcParser(proxy, parsedProxy);
|
|
5505
|
+
if (proxy.xudp) parsedProxy.packet_encoding = "xudp";
|
|
5506
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5507
|
+
if (proxy.network === "ws") wsParser(proxy, parsedProxy);
|
|
5508
|
+
if (proxy.network === "h2") h2Parser(proxy, parsedProxy);
|
|
5509
|
+
if (proxy.network === "http") h1Parser(proxy, parsedProxy);
|
|
5510
|
+
if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
|
|
5570
5511
|
tfoParser(proxy, parsedProxy);
|
|
5571
5512
|
detourParser(proxy, parsedProxy);
|
|
5572
5513
|
tlsParser(proxy, parsedProxy);
|
|
@@ -5584,14 +5525,10 @@ var vlessParser = (proxy = {}) => {
|
|
|
5584
5525
|
};
|
|
5585
5526
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5586
5527
|
throw "invalid port";
|
|
5587
|
-
if (proxy["fast-open"])
|
|
5588
|
-
|
|
5589
|
-
if (proxy.
|
|
5590
|
-
|
|
5591
|
-
if (proxy.network === "ws")
|
|
5592
|
-
wsParser(proxy, parsedProxy);
|
|
5593
|
-
if (proxy.network === "grpc")
|
|
5594
|
-
grpcParser(proxy, parsedProxy);
|
|
5528
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5529
|
+
if (proxy.flow === "xtls-rprx-vision") parsedProxy.flow = proxy.flow;
|
|
5530
|
+
if (proxy.network === "ws") wsParser(proxy, parsedProxy);
|
|
5531
|
+
if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
|
|
5595
5532
|
tfoParser(proxy, parsedProxy);
|
|
5596
5533
|
detourParser(proxy, parsedProxy);
|
|
5597
5534
|
smuxParser(proxy.smux, parsedProxy);
|
|
@@ -5609,12 +5546,9 @@ var trojanParser = (proxy = {}) => {
|
|
|
5609
5546
|
};
|
|
5610
5547
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5611
5548
|
throw "invalid port";
|
|
5612
|
-
if (proxy["fast-open"])
|
|
5613
|
-
|
|
5614
|
-
if (proxy.network === "
|
|
5615
|
-
grpcParser(proxy, parsedProxy);
|
|
5616
|
-
if (proxy.network === "ws")
|
|
5617
|
-
wsParser(proxy, parsedProxy);
|
|
5549
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5550
|
+
if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
|
|
5551
|
+
if (proxy.network === "ws") wsParser(proxy, parsedProxy);
|
|
5618
5552
|
tfoParser(proxy, parsedProxy);
|
|
5619
5553
|
detourParser(proxy, parsedProxy);
|
|
5620
5554
|
tlsParser(proxy, parsedProxy);
|
|
@@ -5632,12 +5566,9 @@ var hysteriaParser = (proxy = {}) => {
|
|
|
5632
5566
|
};
|
|
5633
5567
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5634
5568
|
throw "invalid port";
|
|
5635
|
-
if (proxy.auth_str)
|
|
5636
|
-
|
|
5637
|
-
if (proxy["
|
|
5638
|
-
parsedProxy.auth_str = `${proxy["auth-str"]}`;
|
|
5639
|
-
if (proxy["fast-open"])
|
|
5640
|
-
parsedProxy.udp_fragment = true;
|
|
5569
|
+
if (proxy.auth_str) parsedProxy.auth_str = `${proxy.auth_str}`;
|
|
5570
|
+
if (proxy["auth-str"]) parsedProxy.auth_str = `${proxy["auth-str"]}`;
|
|
5571
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5641
5572
|
const reg = new RegExp("^[0-9]+[ ]*[KMGT]*[Bb]ps$");
|
|
5642
5573
|
if (reg.test(`${proxy.up}`)) {
|
|
5643
5574
|
parsedProxy.up = `${proxy.up}`;
|
|
@@ -5649,16 +5580,13 @@ var hysteriaParser = (proxy = {}) => {
|
|
|
5649
5580
|
} else {
|
|
5650
5581
|
parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);
|
|
5651
5582
|
}
|
|
5652
|
-
if (proxy.obfs)
|
|
5653
|
-
parsedProxy.obfs = proxy.obfs;
|
|
5583
|
+
if (proxy.obfs) parsedProxy.obfs = proxy.obfs;
|
|
5654
5584
|
if (proxy.recv_window_conn)
|
|
5655
5585
|
parsedProxy.recv_window_conn = proxy.recv_window_conn;
|
|
5656
5586
|
if (proxy["recv-window-conn"])
|
|
5657
5587
|
parsedProxy.recv_window_conn = proxy["recv-window-conn"];
|
|
5658
|
-
if (proxy.recv_window)
|
|
5659
|
-
|
|
5660
|
-
if (proxy["recv-window"])
|
|
5661
|
-
parsedProxy.recv_window = proxy["recv-window"];
|
|
5588
|
+
if (proxy.recv_window) parsedProxy.recv_window = proxy.recv_window;
|
|
5589
|
+
if (proxy["recv-window"]) parsedProxy.recv_window = proxy["recv-window"];
|
|
5662
5590
|
if (proxy.disable_mtu_discovery) {
|
|
5663
5591
|
if (typeof proxy.disable_mtu_discovery === "boolean") {
|
|
5664
5592
|
parsedProxy.disable_mtu_discovery = proxy.disable_mtu_discovery;
|
|
@@ -5685,16 +5613,12 @@ var hysteria2Parser = (proxy = {}) => {
|
|
|
5685
5613
|
};
|
|
5686
5614
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5687
5615
|
throw "invalid port";
|
|
5688
|
-
if (proxy.up)
|
|
5689
|
-
|
|
5690
|
-
if (proxy.
|
|
5691
|
-
parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);
|
|
5692
|
-
if (proxy.obfs === "salamander")
|
|
5693
|
-
parsedProxy.obfs.type = "salamander";
|
|
5616
|
+
if (proxy.up) parsedProxy.up_mbps = parseInt(`${proxy.up}`, 10);
|
|
5617
|
+
if (proxy.down) parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);
|
|
5618
|
+
if (proxy.obfs === "salamander") parsedProxy.obfs.type = "salamander";
|
|
5694
5619
|
if (proxy["obfs-password"])
|
|
5695
5620
|
parsedProxy.obfs.password = proxy["obfs-password"];
|
|
5696
|
-
if (!parsedProxy.obfs.type)
|
|
5697
|
-
delete parsedProxy.obfs;
|
|
5621
|
+
if (!parsedProxy.obfs.type) delete parsedProxy.obfs;
|
|
5698
5622
|
tlsParser(proxy, parsedProxy);
|
|
5699
5623
|
tfoParser(proxy, parsedProxy);
|
|
5700
5624
|
detourParser(proxy, parsedProxy);
|
|
@@ -5713,16 +5637,13 @@ var tuic5Parser = (proxy = {}) => {
|
|
|
5713
5637
|
};
|
|
5714
5638
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5715
5639
|
throw "invalid port";
|
|
5716
|
-
if (proxy["fast-open"])
|
|
5717
|
-
parsedProxy.udp_fragment = true;
|
|
5640
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5718
5641
|
if (proxy["congestion-controller"] && proxy["congestion-controller"] !== "cubic")
|
|
5719
5642
|
parsedProxy.congestion_control = proxy["congestion-controller"];
|
|
5720
5643
|
if (proxy["udp-relay-mode"] && proxy["udp-relay-mode"] !== "native")
|
|
5721
5644
|
parsedProxy.udp_relay_mode = proxy["udp-relay-mode"];
|
|
5722
|
-
if (proxy["reduce-rtt"])
|
|
5723
|
-
|
|
5724
|
-
if (proxy["udp-over-stream"])
|
|
5725
|
-
parsedProxy.udp_over_stream = true;
|
|
5645
|
+
if (proxy["reduce-rtt"]) parsedProxy.zero_rtt_handshake = true;
|
|
5646
|
+
if (proxy["udp-over-stream"]) parsedProxy.udp_over_stream = true;
|
|
5726
5647
|
if (proxy["heartbeat-interval"])
|
|
5727
5648
|
parsedProxy.heartbeat = `${proxy["heartbeat-interval"]}ms`;
|
|
5728
5649
|
tfoParser(proxy, parsedProxy);
|
|
@@ -5733,10 +5654,8 @@ var tuic5Parser = (proxy = {}) => {
|
|
|
5733
5654
|
};
|
|
5734
5655
|
var wireguardParser = (proxy = {}) => {
|
|
5735
5656
|
const local_address = ["ip", "ipv6"].map((i) => proxy[i]).map((i) => {
|
|
5736
|
-
if (isIPv4(i))
|
|
5737
|
-
|
|
5738
|
-
if (isIPv6(i))
|
|
5739
|
-
return `${i}/128`;
|
|
5657
|
+
if (isIPv4(i)) return `${i}/32`;
|
|
5658
|
+
if (isIPv6(i)) return `${i}/128`;
|
|
5740
5659
|
}).filter((i) => i);
|
|
5741
5660
|
const parsedProxy = {
|
|
5742
5661
|
tag: proxy.name,
|
|
@@ -5751,13 +5670,11 @@ var wireguardParser = (proxy = {}) => {
|
|
|
5751
5670
|
};
|
|
5752
5671
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5753
5672
|
throw "invalid port";
|
|
5754
|
-
if (proxy["fast-open"])
|
|
5755
|
-
parsedProxy.udp_fragment = true;
|
|
5673
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5756
5674
|
if (typeof proxy.reserved === "string") {
|
|
5757
5675
|
parsedProxy.reserved = proxy.reserved;
|
|
5758
5676
|
} else if (Array.isArray(proxy.reserved)) {
|
|
5759
|
-
for (const r of proxy.reserved)
|
|
5760
|
-
parsedProxy.reserved.push(r);
|
|
5677
|
+
for (const r of proxy.reserved) parsedProxy.reserved.push(r);
|
|
5761
5678
|
} else {
|
|
5762
5679
|
delete parsedProxy.reserved;
|
|
5763
5680
|
}
|
|
@@ -5774,13 +5691,11 @@ var wireguardParser = (proxy = {}) => {
|
|
|
5774
5691
|
if (typeof p.reserved === "string") {
|
|
5775
5692
|
peer.reserved.push(p.reserved);
|
|
5776
5693
|
} else if (Array.isArray(p.reserved)) {
|
|
5777
|
-
for (const r of p.reserved)
|
|
5778
|
-
peer.reserved.push(r);
|
|
5694
|
+
for (const r of p.reserved) peer.reserved.push(r);
|
|
5779
5695
|
} else {
|
|
5780
5696
|
delete peer.reserved;
|
|
5781
5697
|
}
|
|
5782
|
-
if (p["pre-shared-key"])
|
|
5783
|
-
peer.pre_shared_key = p["pre-shared-key"];
|
|
5698
|
+
if (p["pre-shared-key"]) peer.pre_shared_key = p["pre-shared-key"];
|
|
5784
5699
|
parsedProxy.peers.push(peer);
|
|
5785
5700
|
}
|
|
5786
5701
|
}
|
|
@@ -5890,7 +5805,7 @@ function singbox_Producer() {
|
|
|
5890
5805
|
return { type, produce };
|
|
5891
5806
|
}
|
|
5892
5807
|
|
|
5893
|
-
// src/core/proxy-utils/producers/index.js
|
|
5808
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/index.js
|
|
5894
5809
|
function JSON_Producer() {
|
|
5895
5810
|
const type = "ALL";
|
|
5896
5811
|
const produce = (proxies, type2) => type2 === "internal" ? proxies : JSON.stringify(proxies, null, 2);
|
|
@@ -5914,6 +5829,6 @@ var producers_default = {
|
|
|
5914
5829
|
"sing-box": singbox_Producer()
|
|
5915
5830
|
};
|
|
5916
5831
|
export {
|
|
5917
|
-
|
|
5918
|
-
|
|
5832
|
+
parsers_exports as parsers,
|
|
5833
|
+
producers_exports as produce
|
|
5919
5834
|
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sub-store-convert",
|
|
3
|
-
"version": "2.14.
|
|
4
|
-
"description": "Advanced Subscription
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "2.14.418",
|
|
4
|
+
"description": "Advanced Subscription Converter for QX, Loon, Surge, Stash and ShadowRocket.",
|
|
5
|
+
"module": "./build/index.js",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./build/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
7
12
|
"scripts": {
|
|
8
|
-
"
|
|
13
|
+
"build": "node esbuild.config.js"
|
|
9
14
|
},
|
|
10
15
|
"files": [
|
|
11
|
-
"
|
|
16
|
+
"build"
|
|
12
17
|
],
|
|
13
|
-
"author": "tbxark",
|
|
14
|
-
"license": "MIT",
|
|
15
18
|
"dependencies": {
|
|
16
19
|
"ip-address": "^9.0.5",
|
|
17
20
|
"js-base64": "^3.7.7",
|
|
18
21
|
"lodash": "^4.17.21",
|
|
19
22
|
"peggy": "^4.0.3"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"esbuild": "^0.24.0"
|
|
20
26
|
}
|
|
21
27
|
}
|