sub-store-convert 2.14.385 → 2.14.417
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} +182 -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,4 @@
|
|
|
1
|
-
// src/utils/index.js
|
|
1
|
+
// 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
|
-
// src/core/proxy-utils/parsers/peggy/surge.js
|
|
39
|
+
// 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
|
|
@@ -80,7 +80,7 @@ start = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls/tuic/tuic_v
|
|
|
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/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/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") {
|
|
@@ -239,7 +239,7 @@ vmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }
|
|
|
239
239
|
method = comma "encrypt-method" equals cipher:cipher {
|
|
240
240
|
proxy.cipher = cipher;
|
|
241
241
|
}
|
|
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");
|
|
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"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
|
|
243
243
|
|
|
244
244
|
ws = comma "ws" equals flag:bool { obfs.type = "ws"; }
|
|
245
245
|
ws_headers = comma "ws-headers" equals headers:$[^,]+ {
|
|
@@ -258,7 +258,7 @@ obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };
|
|
|
258
258
|
obfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }
|
|
259
259
|
uri = $[^,]+
|
|
260
260
|
|
|
261
|
-
udp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }
|
|
261
|
+
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
|
|
262
262
|
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
|
|
263
263
|
reuse = comma "reuse" equals flag:bool { proxy.reuse = flag; }
|
|
264
264
|
ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
|
|
@@ -279,6 +279,7 @@ idle_timeout = comma "idle-timeout" equals match:$[0-9]+ { proxy["idle-timeout"]
|
|
|
279
279
|
private_key = comma "private-key" equals match:[^,]+ { proxy["keystore-private-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|
280
280
|
server_fingerprint = comma "server-fingerprint" equals match:[^,]+ { proxy["server-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|
281
281
|
block_quic = comma "block-quic" equals match:[^,]+ { proxy["block-quic"] = match.join(""); }
|
|
282
|
+
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
|
|
282
283
|
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
|
|
283
284
|
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
|
|
284
285
|
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
|
|
@@ -301,7 +302,7 @@ function getParser() {
|
|
|
301
302
|
return parser;
|
|
302
303
|
}
|
|
303
304
|
|
|
304
|
-
// src/core/proxy-utils/parsers/peggy/loon.js
|
|
305
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/peggy/loon.js
|
|
305
306
|
import * as peggy2 from "peggy";
|
|
306
307
|
var grammars2 = String.raw`
|
|
307
308
|
// global initializer
|
|
@@ -501,7 +502,7 @@ function getParser2() {
|
|
|
501
502
|
return parser2;
|
|
502
503
|
}
|
|
503
504
|
|
|
504
|
-
// src/core/proxy-utils/parsers/peggy/qx.js
|
|
505
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/peggy/qx.js
|
|
505
506
|
import * as peggy3 from "peggy";
|
|
506
507
|
var grammars3 = String.raw`
|
|
507
508
|
// global initializer
|
|
@@ -707,7 +708,7 @@ function getParser3() {
|
|
|
707
708
|
return parser3;
|
|
708
709
|
}
|
|
709
710
|
|
|
710
|
-
// src/core/proxy-utils/parsers/peggy/trojan-uri.js
|
|
711
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/peggy/trojan-uri.js
|
|
711
712
|
import * as peggy4 from "peggy";
|
|
712
713
|
var grammars4 = String.raw`
|
|
713
714
|
// global initializer
|
|
@@ -850,7 +851,7 @@ function getParser4() {
|
|
|
850
851
|
return parser4;
|
|
851
852
|
}
|
|
852
853
|
|
|
853
|
-
// src/core/proxy-utils/parsers/index.js
|
|
854
|
+
// Sub-Store/backend/src/core/proxy-utils/parsers/index.js
|
|
854
855
|
import { Base64 } from "js-base64";
|
|
855
856
|
function surge_port_hopping(raw) {
|
|
856
857
|
const [parts, port_hopping] = raw.match(
|
|
@@ -914,8 +915,7 @@ function URI_SS() {
|
|
|
914
915
|
const params = {};
|
|
915
916
|
for (const item of pluginInfo) {
|
|
916
917
|
const [key, val] = item.split("=");
|
|
917
|
-
if (key)
|
|
918
|
-
params[key] = val || true;
|
|
918
|
+
if (key) params[key] = val || true;
|
|
919
919
|
}
|
|
920
920
|
switch (params.plugin) {
|
|
921
921
|
case "obfs-local":
|
|
@@ -1098,7 +1098,7 @@ function URI_VMess() {
|
|
|
1098
1098
|
params.allowInsecure
|
|
1099
1099
|
);
|
|
1100
1100
|
}
|
|
1101
|
-
if (proxy.tls &&
|
|
1101
|
+
if (proxy.tls && params.sni && params.sni !== "") {
|
|
1102
1102
|
proxy.sni = params.sni;
|
|
1103
1103
|
}
|
|
1104
1104
|
let httpupgrade = false;
|
|
@@ -1156,9 +1156,6 @@ function URI_VMess() {
|
|
|
1156
1156
|
} else {
|
|
1157
1157
|
delete proxy.network;
|
|
1158
1158
|
}
|
|
1159
|
-
if (proxy.tls && !proxy.sni && transportHost) {
|
|
1160
|
-
proxy.sni = transportHost;
|
|
1161
|
-
}
|
|
1162
1159
|
}
|
|
1163
1160
|
return proxy;
|
|
1164
1161
|
}
|
|
@@ -1282,13 +1279,11 @@ function URI_VLESS() {
|
|
|
1282
1279
|
if (Object.keys(opts).length > 0) {
|
|
1283
1280
|
proxy[`${proxy.network}-opts`] = opts;
|
|
1284
1281
|
}
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
let httpHost = proxy["http-opts"]?.headers?.Host;
|
|
1291
|
-
proxy.sni = Array.isArray(httpHost) ? httpHost[0] : httpHost;
|
|
1282
|
+
if (proxy.network === "kcp") {
|
|
1283
|
+
if (params.seed) {
|
|
1284
|
+
proxy.seed = params.seed;
|
|
1285
|
+
}
|
|
1286
|
+
proxy.headerType = params.headerType || "none";
|
|
1292
1287
|
}
|
|
1293
1288
|
}
|
|
1294
1289
|
return proxy;
|
|
@@ -1597,14 +1592,6 @@ function Clash_All() {
|
|
|
1597
1592
|
if (["vmess", "vless"].includes(proxy.type)) {
|
|
1598
1593
|
proxy.sni = proxy.servername;
|
|
1599
1594
|
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
1595
|
}
|
|
1609
1596
|
if (proxy["server-cert-fingerprint"]) {
|
|
1610
1597
|
proxy["tls-fingerprint"] = proxy["server-cert-fingerprint"];
|
|
@@ -2041,7 +2028,7 @@ var parsers_default = [
|
|
|
2041
2028
|
QX_Socks5()
|
|
2042
2029
|
];
|
|
2043
2030
|
|
|
2044
|
-
// src/core/proxy-utils/producers/utils.js
|
|
2031
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/utils.js
|
|
2045
2032
|
import _ from "lodash";
|
|
2046
2033
|
var Result = class {
|
|
2047
2034
|
constructor(proxy) {
|
|
@@ -2068,16 +2055,14 @@ function isPresent2(obj, attr) {
|
|
|
2068
2055
|
return typeof data !== "undefined" && data !== null;
|
|
2069
2056
|
}
|
|
2070
2057
|
|
|
2071
|
-
// src/
|
|
2072
|
-
var app_default = new Proxy(
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
console.log(`[${property}]`, ...args);
|
|
2076
|
-
};
|
|
2058
|
+
// src/core/app/index.js
|
|
2059
|
+
var app_default = new Proxy(target, {
|
|
2060
|
+
apply: function(target2, thisArg, argumentsList) {
|
|
2061
|
+
console.log(`Function called with arguments: ${argumentsList.join(", ")}`);
|
|
2077
2062
|
}
|
|
2078
2063
|
});
|
|
2079
2064
|
|
|
2080
|
-
// src/core/proxy-utils/producers/surge.js
|
|
2065
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/surge.js
|
|
2081
2066
|
var targetPlatform = "Surge";
|
|
2082
2067
|
var ipVersions = {
|
|
2083
2068
|
dual: "dual",
|
|
@@ -2094,7 +2079,7 @@ function Surge_Producer() {
|
|
|
2094
2079
|
}
|
|
2095
2080
|
switch (proxy.type) {
|
|
2096
2081
|
case "ss":
|
|
2097
|
-
return shadowsocks(proxy);
|
|
2082
|
+
return shadowsocks(proxy, opts["include-unsupported-proxy"]);
|
|
2098
2083
|
case "trojan":
|
|
2099
2084
|
return trojan(proxy);
|
|
2100
2085
|
case "vmess":
|
|
@@ -2123,7 +2108,7 @@ function Surge_Producer() {
|
|
|
2123
2108
|
};
|
|
2124
2109
|
return { produce };
|
|
2125
2110
|
}
|
|
2126
|
-
function shadowsocks(proxy) {
|
|
2111
|
+
function shadowsocks(proxy, includeUnsupportedProxy) {
|
|
2127
2112
|
const result = new Result(proxy);
|
|
2128
2113
|
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
|
|
2129
2114
|
if (!proxy.cipher) {
|
|
@@ -2155,7 +2140,8 @@ function shadowsocks(proxy) {
|
|
|
2155
2140
|
"salsa20",
|
|
2156
2141
|
"chacha20",
|
|
2157
2142
|
"chacha20-ietf",
|
|
2158
|
-
"none"
|
|
2143
|
+
"none",
|
|
2144
|
+
...includeUnsupportedProxy ? ["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm"] : []
|
|
2159
2145
|
].includes(proxy.cipher)) {
|
|
2160
2146
|
throw new Error(`cipher ${proxy.cipher} is not supported`);
|
|
2161
2147
|
}
|
|
@@ -2184,6 +2170,7 @@ function shadowsocks(proxy) {
|
|
|
2184
2170
|
}
|
|
2185
2171
|
result.appendIfPresent(`,tfo=${proxy.tfo}`, "tfo");
|
|
2186
2172
|
result.appendIfPresent(`,udp-relay=${proxy.udp}`, "udp");
|
|
2173
|
+
result.appendIfPresent(`,udp-port=${proxy["udp-port"]}`, "udp-port");
|
|
2187
2174
|
result.appendIfPresent(`,test-url=${proxy["test-url"]}`, "test-url");
|
|
2188
2175
|
result.appendIfPresent(
|
|
2189
2176
|
`,test-timeout=${proxy["test-timeout"]}`,
|
|
@@ -2908,16 +2895,15 @@ function handleTransport(result, proxy, includeUnsupportedProxy) {
|
|
|
2908
2895
|
}
|
|
2909
2896
|
}
|
|
2910
2897
|
|
|
2911
|
-
// src/core/proxy-utils/producers/surgemac.js
|
|
2898
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/surgemac.js
|
|
2912
2899
|
import { Base64 as Base642 } from "js-base64";
|
|
2913
2900
|
|
|
2914
|
-
// src/core/proxy-utils/producers/clashmeta.js
|
|
2901
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/clashmeta.js
|
|
2915
2902
|
function ClashMeta_Producer() {
|
|
2916
2903
|
const type = "ALL";
|
|
2917
2904
|
const produce = (proxies, type2, opts = {}) => {
|
|
2918
2905
|
const list = proxies.filter((proxy) => {
|
|
2919
|
-
if (opts["include-unsupported-proxy"])
|
|
2920
|
-
return true;
|
|
2906
|
+
if (opts["include-unsupported-proxy"]) return true;
|
|
2921
2907
|
if (proxy.type === "snell" && String(proxy.version) === "4") {
|
|
2922
2908
|
return false;
|
|
2923
2909
|
}
|
|
@@ -3051,7 +3037,7 @@ function ClashMeta_Producer() {
|
|
|
3051
3037
|
return { type, produce };
|
|
3052
3038
|
}
|
|
3053
3039
|
|
|
3054
|
-
// src/core/proxy-utils/producers/surgemac.js
|
|
3040
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/surgemac.js
|
|
3055
3041
|
var targetPlatform2 = "SurgeMac";
|
|
3056
3042
|
var surge_Producer = Surge_Producer();
|
|
3057
3043
|
function SurgeMac_Producer() {
|
|
@@ -3059,14 +3045,22 @@ function SurgeMac_Producer() {
|
|
|
3059
3045
|
switch (proxy.type) {
|
|
3060
3046
|
case "external":
|
|
3061
3047
|
return external(proxy);
|
|
3048
|
+
// case 'ssr':
|
|
3049
|
+
// return shadowsocksr(proxy);
|
|
3062
3050
|
default: {
|
|
3063
3051
|
try {
|
|
3064
3052
|
return surge_Producer.produce(proxy, type, opts);
|
|
3065
3053
|
} catch (e) {
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3054
|
+
if (opts.useMihomoExternal) {
|
|
3055
|
+
app_default.log(
|
|
3056
|
+
`${proxy.name} is not supported on ${targetPlatform2}, try to use Mihomo(SurgeMac - External Proxy Program) instead`
|
|
3057
|
+
);
|
|
3058
|
+
return mihomo(proxy, type, opts);
|
|
3059
|
+
} else {
|
|
3060
|
+
throw new Error(
|
|
3061
|
+
`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`
|
|
3062
|
+
);
|
|
3063
|
+
}
|
|
3070
3064
|
}
|
|
3071
3065
|
}
|
|
3072
3066
|
}
|
|
@@ -3162,13 +3156,12 @@ function isIP2(ip) {
|
|
|
3162
3156
|
return isIPv4(ip) || isIPv6(ip);
|
|
3163
3157
|
}
|
|
3164
3158
|
|
|
3165
|
-
// src/core/proxy-utils/producers/clash.js
|
|
3159
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/clash.js
|
|
3166
3160
|
function Clash_Producer() {
|
|
3167
3161
|
const type = "ALL";
|
|
3168
3162
|
const produce = (proxies, type2, opts = {}) => {
|
|
3169
3163
|
const list = proxies.filter((proxy) => {
|
|
3170
|
-
if (opts["include-unsupported-proxy"])
|
|
3171
|
-
return true;
|
|
3164
|
+
if (opts["include-unsupported-proxy"]) return true;
|
|
3172
3165
|
if (![
|
|
3173
3166
|
"ss",
|
|
3174
3167
|
"ssr",
|
|
@@ -3296,13 +3289,12 @@ function Clash_Producer() {
|
|
|
3296
3289
|
return { type, produce };
|
|
3297
3290
|
}
|
|
3298
3291
|
|
|
3299
|
-
// src/core/proxy-utils/producers/stash.js
|
|
3292
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/stash.js
|
|
3300
3293
|
function Stash_Producer() {
|
|
3301
3294
|
const type = "ALL";
|
|
3302
3295
|
const produce = (proxies, type2, opts = {}) => {
|
|
3303
3296
|
const list = proxies.filter((proxy) => {
|
|
3304
|
-
if (opts["include-unsupported-proxy"])
|
|
3305
|
-
return true;
|
|
3297
|
+
if (opts["include-unsupported-proxy"]) return true;
|
|
3306
3298
|
if (![
|
|
3307
3299
|
"ss",
|
|
3308
3300
|
"ssr",
|
|
@@ -3504,7 +3496,7 @@ function Stash_Producer() {
|
|
|
3504
3496
|
return { type, produce };
|
|
3505
3497
|
}
|
|
3506
3498
|
|
|
3507
|
-
// src/core/proxy-utils/producers/loon.js
|
|
3499
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/loon.js
|
|
3508
3500
|
var targetPlatform3 = "Loon";
|
|
3509
3501
|
function Loon_Producer() {
|
|
3510
3502
|
const produce = (proxy) => {
|
|
@@ -3883,7 +3875,7 @@ function hysteria22(proxy) {
|
|
|
3883
3875
|
return result.toString();
|
|
3884
3876
|
}
|
|
3885
3877
|
|
|
3886
|
-
// src/core/proxy-utils/producers/uri.js
|
|
3878
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/uri.js
|
|
3887
3879
|
import { Base64 as Base643 } from "js-base64";
|
|
3888
3880
|
function URI_Producer() {
|
|
3889
3881
|
const type = "SINGLE";
|
|
@@ -4053,6 +4045,18 @@ function URI_Producer() {
|
|
|
4053
4045
|
vlessTransportServiceName
|
|
4054
4046
|
)}`;
|
|
4055
4047
|
}
|
|
4048
|
+
if (proxy.network === "kcp") {
|
|
4049
|
+
if (proxy.seed) {
|
|
4050
|
+
vlessTransport += `&seed=${encodeURIComponent(
|
|
4051
|
+
proxy.seed
|
|
4052
|
+
)}`;
|
|
4053
|
+
}
|
|
4054
|
+
if (proxy.headerType) {
|
|
4055
|
+
vlessTransport += `&headerType=${encodeURIComponent(
|
|
4056
|
+
proxy.headerType
|
|
4057
|
+
)}`;
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4056
4060
|
result = `vless://${proxy.uuid}@${proxy.server}:${proxy.port}?security=${encodeURIComponent(
|
|
4057
4061
|
security
|
|
4058
4062
|
)}${vlessTransport}${alpn}${allowInsecure}${sni}${fp}${flow}${sid}${pbk}#${encodeURIComponent(
|
|
@@ -4269,7 +4273,7 @@ function URI_Producer() {
|
|
|
4269
4273
|
return { type, produce };
|
|
4270
4274
|
}
|
|
4271
4275
|
|
|
4272
|
-
// src/core/proxy-utils/producers/v2ray.js
|
|
4276
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/v2ray.js
|
|
4273
4277
|
import { Base64 as Base644 } from "js-base64";
|
|
4274
4278
|
var URI = URI_Producer();
|
|
4275
4279
|
function V2Ray_Producer() {
|
|
@@ -4295,7 +4299,7 @@ Reason: ${err}`
|
|
|
4295
4299
|
return { type, produce };
|
|
4296
4300
|
}
|
|
4297
4301
|
|
|
4298
|
-
// src/core/proxy-utils/producers/qx.js
|
|
4302
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/qx.js
|
|
4299
4303
|
var targetPlatform4 = "QX";
|
|
4300
4304
|
function QX_Producer() {
|
|
4301
4305
|
const produce = (proxy, type, opts = {}) => {
|
|
@@ -4365,10 +4369,8 @@ function shadowsocks3(proxy) {
|
|
|
4365
4369
|
append(`,obfs=${opts.mode}`);
|
|
4366
4370
|
} else if (proxy.plugin === "v2ray-plugin" && proxy["plugin-opts"].mode === "websocket") {
|
|
4367
4371
|
const opts = proxy["plugin-opts"];
|
|
4368
|
-
if (opts.tls)
|
|
4369
|
-
|
|
4370
|
-
else
|
|
4371
|
-
append(`,obfs=ws`);
|
|
4372
|
+
if (opts.tls) append(`,obfs=wss`);
|
|
4373
|
+
else append(`,obfs=ws`);
|
|
4372
4374
|
} else {
|
|
4373
4375
|
throw new Error(`plugin is not supported`);
|
|
4374
4376
|
}
|
|
@@ -4445,10 +4447,8 @@ function trojan3(proxy) {
|
|
|
4445
4447
|
append(`,password=${proxy.password}`);
|
|
4446
4448
|
if (isPresent2(proxy, "network")) {
|
|
4447
4449
|
if (proxy.network === "ws") {
|
|
4448
|
-
if (needTls(proxy))
|
|
4449
|
-
|
|
4450
|
-
else
|
|
4451
|
-
append(`,obfs=ws`);
|
|
4450
|
+
if (needTls(proxy)) append(`,obfs=wss`);
|
|
4451
|
+
else append(`,obfs=ws`);
|
|
4452
4452
|
appendIfPresent(
|
|
4453
4453
|
`,obfs-uri=${proxy["ws-opts"]?.path}`,
|
|
4454
4454
|
"ws-opts.path"
|
|
@@ -4515,10 +4515,8 @@ function vmess3(proxy) {
|
|
|
4515
4515
|
}
|
|
4516
4516
|
if (isPresent2(proxy, "network")) {
|
|
4517
4517
|
if (proxy.network === "ws") {
|
|
4518
|
-
if (proxy.tls)
|
|
4519
|
-
|
|
4520
|
-
else
|
|
4521
|
-
append(`,obfs=ws`);
|
|
4518
|
+
if (proxy.tls) append(`,obfs=wss`);
|
|
4519
|
+
else append(`,obfs=ws`);
|
|
4522
4520
|
} else if (proxy.network === "http") {
|
|
4523
4521
|
append(`,obfs=http`);
|
|
4524
4522
|
} else {
|
|
@@ -4535,8 +4533,7 @@ function vmess3(proxy) {
|
|
|
4535
4533
|
`${proxy.network}-opts.headers.Host`
|
|
4536
4534
|
);
|
|
4537
4535
|
} else {
|
|
4538
|
-
if (proxy.tls)
|
|
4539
|
-
append(`,obfs=over-tls`);
|
|
4536
|
+
if (proxy.tls) append(`,obfs=over-tls`);
|
|
4540
4537
|
}
|
|
4541
4538
|
if (needTls(proxy)) {
|
|
4542
4539
|
appendIfPresent(
|
|
@@ -4592,10 +4589,8 @@ function vless2(proxy) {
|
|
|
4592
4589
|
}
|
|
4593
4590
|
if (isPresent2(proxy, "network")) {
|
|
4594
4591
|
if (proxy.network === "ws") {
|
|
4595
|
-
if (proxy.tls)
|
|
4596
|
-
|
|
4597
|
-
else
|
|
4598
|
-
append(`,obfs=ws`);
|
|
4592
|
+
if (proxy.tls) append(`,obfs=wss`);
|
|
4593
|
+
else append(`,obfs=ws`);
|
|
4599
4594
|
} else if (proxy.network === "http") {
|
|
4600
4595
|
append(`,obfs=http`);
|
|
4601
4596
|
} else if (!["tcp"].includes(proxy.network)) {
|
|
@@ -4612,8 +4607,7 @@ function vless2(proxy) {
|
|
|
4612
4607
|
`${proxy.network}-opts.headers.Host`
|
|
4613
4608
|
);
|
|
4614
4609
|
} else {
|
|
4615
|
-
if (proxy.tls)
|
|
4616
|
-
append(`,obfs=over-tls`);
|
|
4610
|
+
if (proxy.tls) append(`,obfs=over-tls`);
|
|
4617
4611
|
}
|
|
4618
4612
|
if (needTls(proxy)) {
|
|
4619
4613
|
appendIfPresent(
|
|
@@ -4740,13 +4734,12 @@ function needTls(proxy) {
|
|
|
4740
4734
|
return proxy.tls;
|
|
4741
4735
|
}
|
|
4742
4736
|
|
|
4743
|
-
// src/core/proxy-utils/producers/shadowrocket.js
|
|
4737
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/shadowrocket.js
|
|
4744
4738
|
function ShadowRocket_Producer() {
|
|
4745
4739
|
const type = "ALL";
|
|
4746
4740
|
const produce = (proxies, type2, opts = {}) => {
|
|
4747
4741
|
const list = proxies.filter((proxy) => {
|
|
4748
|
-
if (opts["include-unsupported-proxy"])
|
|
4749
|
-
return true;
|
|
4742
|
+
if (opts["include-unsupported-proxy"]) return true;
|
|
4750
4743
|
if (proxy.type === "snell" && String(proxy.version) === "4") {
|
|
4751
4744
|
return false;
|
|
4752
4745
|
}
|
|
@@ -4884,7 +4877,7 @@ function ShadowRocket_Producer() {
|
|
|
4884
4877
|
return { type, produce };
|
|
4885
4878
|
}
|
|
4886
4879
|
|
|
4887
|
-
// src/core/proxy-utils/producers/surfboard.js
|
|
4880
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/surfboard.js
|
|
4888
4881
|
var targetPlatform5 = "Surfboard";
|
|
4889
4882
|
function Surfboard_Producer() {
|
|
4890
4883
|
const produce = (proxy) => {
|
|
@@ -5056,25 +5049,19 @@ function handleTransport2(result, proxy) {
|
|
|
5056
5049
|
}
|
|
5057
5050
|
}
|
|
5058
5051
|
|
|
5059
|
-
// src/core/proxy-utils/producers/sing-box.js
|
|
5052
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/sing-box.js
|
|
5060
5053
|
var detourParser = (proxy, parsedProxy) => {
|
|
5061
|
-
if (proxy["dialer-proxy"])
|
|
5062
|
-
parsedProxy.detour = proxy["dialer-proxy"];
|
|
5054
|
+
if (proxy["dialer-proxy"]) parsedProxy.detour = proxy["dialer-proxy"];
|
|
5063
5055
|
};
|
|
5064
5056
|
var tfoParser = (proxy, parsedProxy) => {
|
|
5065
5057
|
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;
|
|
5058
|
+
if (proxy.tfo) parsedProxy.tcp_fast_open = true;
|
|
5059
|
+
if (proxy.tcp_fast_open) parsedProxy.tcp_fast_open = true;
|
|
5060
|
+
if (proxy["tcp-fast-open"]) parsedProxy.tcp_fast_open = true;
|
|
5061
|
+
if (!parsedProxy.tcp_fast_open) delete parsedProxy.tcp_fast_open;
|
|
5074
5062
|
};
|
|
5075
5063
|
var smuxParser = (smux, proxy) => {
|
|
5076
|
-
if (!smux || !smux.enabled)
|
|
5077
|
-
return;
|
|
5064
|
+
if (!smux || !smux.enabled) return;
|
|
5078
5065
|
proxy.multiplex = { enabled: true };
|
|
5079
5066
|
proxy.multiplex.protocol = smux.protocol;
|
|
5080
5067
|
if (smux["max-connections"])
|
|
@@ -5086,32 +5073,26 @@ var smuxParser = (smux, proxy) => {
|
|
|
5086
5073
|
proxy.multiplex.max_streams = parseInt(`${smux["max-streams"]}`, 10);
|
|
5087
5074
|
if (smux["min-streams"])
|
|
5088
5075
|
proxy.multiplex.min_streams = parseInt(`${smux["min-streams"]}`, 10);
|
|
5089
|
-
if (smux.padding)
|
|
5090
|
-
proxy.multiplex.padding = true;
|
|
5076
|
+
if (smux.padding) proxy.multiplex.padding = true;
|
|
5091
5077
|
};
|
|
5092
5078
|
var wsParser = (proxy, parsedProxy) => {
|
|
5093
5079
|
const transport = { type: "ws", headers: {} };
|
|
5094
5080
|
if (proxy["ws-opts"]) {
|
|
5095
5081
|
const { path: wsPath = "", headers: wsHeaders = {} } = proxy["ws-opts"];
|
|
5096
|
-
if (wsPath !== "")
|
|
5097
|
-
transport.path = `${wsPath}`;
|
|
5082
|
+
if (wsPath !== "") transport.path = `${wsPath}`;
|
|
5098
5083
|
if (Object.keys(wsHeaders).length > 0) {
|
|
5099
5084
|
const headers = {};
|
|
5100
5085
|
for (const key of Object.keys(wsHeaders)) {
|
|
5101
5086
|
let value = wsHeaders[key];
|
|
5102
|
-
if (value === "")
|
|
5103
|
-
|
|
5104
|
-
if (
|
|
5105
|
-
value = [`${value}`];
|
|
5106
|
-
if (value.length > 0)
|
|
5107
|
-
headers[key] = value;
|
|
5087
|
+
if (value === "") continue;
|
|
5088
|
+
if (!Array.isArray(value)) value = [`${value}`];
|
|
5089
|
+
if (value.length > 0) headers[key] = value;
|
|
5108
5090
|
}
|
|
5109
5091
|
const { Host: wsHost } = headers;
|
|
5110
5092
|
if (wsHost.length === 1)
|
|
5111
5093
|
for (const item of `Host:${wsHost[0]}`.split("\n")) {
|
|
5112
5094
|
const [key, value] = item.split(":");
|
|
5113
|
-
if (value.trim() === "")
|
|
5114
|
-
continue;
|
|
5095
|
+
if (value.trim() === "") continue;
|
|
5115
5096
|
headers[key.trim()] = value.trim().split(",");
|
|
5116
5097
|
}
|
|
5117
5098
|
transport.headers = headers;
|
|
@@ -5121,19 +5102,15 @@ var wsParser = (proxy, parsedProxy) => {
|
|
|
5121
5102
|
const headers = {};
|
|
5122
5103
|
for (const key of Object.keys(proxy["ws-headers"])) {
|
|
5123
5104
|
let value = proxy["ws-headers"][key];
|
|
5124
|
-
if (value === "")
|
|
5125
|
-
|
|
5126
|
-
if (
|
|
5127
|
-
value = [`${value}`];
|
|
5128
|
-
if (value.length > 0)
|
|
5129
|
-
headers[key] = value;
|
|
5105
|
+
if (value === "") continue;
|
|
5106
|
+
if (!Array.isArray(value)) value = [`${value}`];
|
|
5107
|
+
if (value.length > 0) headers[key] = value;
|
|
5130
5108
|
}
|
|
5131
5109
|
const { Host: wsHost } = headers;
|
|
5132
5110
|
if (wsHost.length === 1)
|
|
5133
5111
|
for (const item of `Host:${wsHost[0]}`.split("\n")) {
|
|
5134
5112
|
const [key, value] = item.split(":");
|
|
5135
|
-
if (value.trim() === "")
|
|
5136
|
-
continue;
|
|
5113
|
+
if (value.trim() === "") continue;
|
|
5137
5114
|
headers[key.trim()] = value.trim().split(",");
|
|
5138
5115
|
}
|
|
5139
5116
|
for (const key of Object.keys(headers))
|
|
@@ -5158,15 +5135,13 @@ var wsParser = (proxy, parsedProxy) => {
|
|
|
5158
5135
|
transport.host = transport.headers.Host[0];
|
|
5159
5136
|
delete transport.headers.Host;
|
|
5160
5137
|
}
|
|
5161
|
-
if (transport.max_early_data)
|
|
5162
|
-
delete transport.max_early_data;
|
|
5138
|
+
if (transport.max_early_data) delete transport.max_early_data;
|
|
5163
5139
|
if (transport.early_data_header_name)
|
|
5164
5140
|
delete transport.early_data_header_name;
|
|
5165
5141
|
}
|
|
5166
5142
|
for (const key of Object.keys(transport.headers)) {
|
|
5167
5143
|
const value = transport.headers[key];
|
|
5168
|
-
if (value.length === 1)
|
|
5169
|
-
transport.headers[key] = value[0];
|
|
5144
|
+
if (value.length === 1) transport.headers[key] = value[0];
|
|
5170
5145
|
}
|
|
5171
5146
|
parsedProxy.transport = transport;
|
|
5172
5147
|
};
|
|
@@ -5178,54 +5153,44 @@ var h1Parser = (proxy, parsedProxy) => {
|
|
|
5178
5153
|
path: h1Path = "",
|
|
5179
5154
|
headers: h1Headers = {}
|
|
5180
5155
|
} = proxy["http-opts"];
|
|
5181
|
-
if (method !== "")
|
|
5182
|
-
transport.method = method;
|
|
5156
|
+
if (method !== "") transport.method = method;
|
|
5183
5157
|
if (Array.isArray(h1Path)) {
|
|
5184
5158
|
transport.path = `${h1Path[0]}`;
|
|
5185
|
-
} else if (h1Path !== "")
|
|
5186
|
-
transport.path = `${h1Path}`;
|
|
5159
|
+
} else if (h1Path !== "") transport.path = `${h1Path}`;
|
|
5187
5160
|
for (const key of Object.keys(h1Headers)) {
|
|
5188
5161
|
let value = h1Headers[key];
|
|
5189
|
-
if (value === "")
|
|
5190
|
-
continue;
|
|
5162
|
+
if (value === "") continue;
|
|
5191
5163
|
if (key.toLowerCase() === "host") {
|
|
5192
5164
|
let host = value;
|
|
5193
5165
|
if (!Array.isArray(host))
|
|
5194
5166
|
host = `${host}`.split(",").map((i) => i.trim());
|
|
5195
|
-
if (host.length > 0)
|
|
5196
|
-
transport.host = host;
|
|
5167
|
+
if (host.length > 0) transport.host = host;
|
|
5197
5168
|
continue;
|
|
5198
5169
|
}
|
|
5199
5170
|
if (!Array.isArray(value))
|
|
5200
5171
|
value = `${value}`.split(",").map((i) => i.trim());
|
|
5201
|
-
if (value.length > 0)
|
|
5202
|
-
transport.headers[key] = value;
|
|
5172
|
+
if (value.length > 0) transport.headers[key] = value;
|
|
5203
5173
|
}
|
|
5204
5174
|
}
|
|
5205
5175
|
if (proxy["http-host"] && proxy["http-host"] !== "") {
|
|
5206
5176
|
let host = proxy["http-host"];
|
|
5207
5177
|
if (!Array.isArray(host))
|
|
5208
5178
|
host = `${host}`.split(",").map((i) => i.trim());
|
|
5209
|
-
if (host.length > 0)
|
|
5210
|
-
transport.host = host;
|
|
5179
|
+
if (host.length > 0) transport.host = host;
|
|
5211
5180
|
}
|
|
5212
|
-
if (!transport.host)
|
|
5213
|
-
return;
|
|
5181
|
+
if (!transport.host) return;
|
|
5214
5182
|
if (proxy["http-path"] && proxy["http-path"] !== "") {
|
|
5215
5183
|
const path = proxy["http-path"];
|
|
5216
5184
|
if (Array.isArray(path)) {
|
|
5217
5185
|
transport.path = `${path[0]}`;
|
|
5218
|
-
} else if (path !== "")
|
|
5219
|
-
transport.path = `${path}`;
|
|
5186
|
+
} else if (path !== "") transport.path = `${path}`;
|
|
5220
5187
|
}
|
|
5221
5188
|
if (parsedProxy.tls.insecure)
|
|
5222
5189
|
parsedProxy.tls.server_name = transport.host[0];
|
|
5223
|
-
if (transport.host.length === 1)
|
|
5224
|
-
transport.host = transport.host[0];
|
|
5190
|
+
if (transport.host.length === 1) transport.host = transport.host[0];
|
|
5225
5191
|
for (const key of Object.keys(transport.headers)) {
|
|
5226
5192
|
const value = transport.headers[key];
|
|
5227
|
-
if (value.length === 1)
|
|
5228
|
-
transport.headers[key] = value[0];
|
|
5193
|
+
if (value.length === 1) transport.headers[key] = value[0];
|
|
5229
5194
|
}
|
|
5230
5195
|
parsedProxy.transport = transport;
|
|
5231
5196
|
};
|
|
@@ -5233,29 +5198,25 @@ var h2Parser = (proxy, parsedProxy) => {
|
|
|
5233
5198
|
const transport = { type: "http" };
|
|
5234
5199
|
if (proxy["h2-opts"]) {
|
|
5235
5200
|
let { host = "", path = "" } = proxy["h2-opts"];
|
|
5236
|
-
if (path !== "")
|
|
5237
|
-
transport.path = `${path}`;
|
|
5201
|
+
if (path !== "") transport.path = `${path}`;
|
|
5238
5202
|
if (host !== "") {
|
|
5239
5203
|
if (!Array.isArray(host))
|
|
5240
5204
|
host = `${host}`.split(",").map((i) => i.trim());
|
|
5241
|
-
if (host.length > 0)
|
|
5242
|
-
transport.host = host;
|
|
5205
|
+
if (host.length > 0) transport.host = host;
|
|
5243
5206
|
}
|
|
5244
5207
|
}
|
|
5245
5208
|
if (proxy["h2-host"] && proxy["h2-host"] !== "") {
|
|
5246
5209
|
let host = proxy["h2-host"];
|
|
5247
5210
|
if (!Array.isArray(host))
|
|
5248
5211
|
host = `${host}`.split(",").map((i) => i.trim());
|
|
5249
|
-
if (host.length > 0)
|
|
5250
|
-
transport.host = host;
|
|
5212
|
+
if (host.length > 0) transport.host = host;
|
|
5251
5213
|
}
|
|
5252
5214
|
if (proxy["h2-path"] && proxy["h2-path"] !== "")
|
|
5253
5215
|
transport.path = `${proxy["h2-path"]}`;
|
|
5254
5216
|
parsedProxy.tls.enabled = true;
|
|
5255
5217
|
if (parsedProxy.tls.insecure)
|
|
5256
5218
|
parsedProxy.tls.server_name = transport.host[0];
|
|
5257
|
-
if (transport.host.length === 1)
|
|
5258
|
-
transport.host = transport.host[0];
|
|
5219
|
+
if (transport.host.length === 1) transport.host = transport.host[0];
|
|
5259
5220
|
parsedProxy.transport = transport;
|
|
5260
5221
|
};
|
|
5261
5222
|
var grpcParser = (proxy, parsedProxy) => {
|
|
@@ -5268,30 +5229,21 @@ var grpcParser = (proxy, parsedProxy) => {
|
|
|
5268
5229
|
parsedProxy.transport = transport;
|
|
5269
5230
|
};
|
|
5270
5231
|
var tlsParser = (proxy, parsedProxy) => {
|
|
5271
|
-
if (proxy.tls)
|
|
5272
|
-
parsedProxy.tls.enabled = true;
|
|
5232
|
+
if (proxy.tls) parsedProxy.tls.enabled = true;
|
|
5273
5233
|
if (proxy.servername && proxy.servername !== "")
|
|
5274
5234
|
parsedProxy.tls.server_name = proxy.servername;
|
|
5275
5235
|
if (proxy.peer && proxy.peer !== "")
|
|
5276
5236
|
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;
|
|
5237
|
+
if (proxy.sni && proxy.sni !== "") parsedProxy.tls.server_name = proxy.sni;
|
|
5238
|
+
if (proxy["skip-cert-verify"]) parsedProxy.tls.insecure = true;
|
|
5239
|
+
if (proxy.insecure) parsedProxy.tls.insecure = true;
|
|
5240
|
+
if (proxy["disable-sni"]) parsedProxy.tls.disable_sni = true;
|
|
5285
5241
|
if (typeof proxy.alpn === "string") {
|
|
5286
5242
|
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"]];
|
|
5243
|
+
} else if (Array.isArray(proxy.alpn)) parsedProxy.tls.alpn = proxy.alpn;
|
|
5244
|
+
if (proxy.ca) parsedProxy.tls.certificate_path = `${proxy.ca}`;
|
|
5245
|
+
if (proxy.ca_str) parsedProxy.tls.certificate = [proxy.ca_str];
|
|
5246
|
+
if (proxy["ca-str"]) parsedProxy.tls.certificate = [proxy["ca-str"]];
|
|
5295
5247
|
if (proxy["reality-opts"]) {
|
|
5296
5248
|
parsedProxy.tls.reality = { enabled: true };
|
|
5297
5249
|
if (proxy["reality-opts"]["public-key"])
|
|
@@ -5305,8 +5257,7 @@ var tlsParser = (proxy, parsedProxy) => {
|
|
|
5305
5257
|
enabled: true,
|
|
5306
5258
|
fingerprint: proxy["client-fingerprint"]
|
|
5307
5259
|
};
|
|
5308
|
-
if (!parsedProxy.tls.enabled)
|
|
5309
|
-
delete parsedProxy.tls;
|
|
5260
|
+
if (!parsedProxy.tls.enabled) delete parsedProxy.tls;
|
|
5310
5261
|
};
|
|
5311
5262
|
var sshParser = (proxy = {}) => {
|
|
5312
5263
|
const parsedProxy = {
|
|
@@ -5317,12 +5268,9 @@ var sshParser = (proxy = {}) => {
|
|
|
5317
5268
|
};
|
|
5318
5269
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5319
5270
|
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"];
|
|
5271
|
+
if (proxy.username) parsedProxy.user = proxy.username;
|
|
5272
|
+
if (proxy.password) parsedProxy.password = proxy.password;
|
|
5273
|
+
if (proxy["privateKey"]) parsedProxy.private_key_path = proxy["privateKey"];
|
|
5326
5274
|
if (proxy["private-key"])
|
|
5327
5275
|
parsedProxy.private_key_path = proxy["private-key"];
|
|
5328
5276
|
if (proxy["private-key-passphrase"])
|
|
@@ -5333,12 +5281,10 @@ var sshParser = (proxy = {}) => {
|
|
|
5333
5281
|
proxy["server-fingerprint"].split(" ")[0]
|
|
5334
5282
|
];
|
|
5335
5283
|
}
|
|
5336
|
-
if (proxy["host-key"])
|
|
5337
|
-
parsedProxy.host_key = proxy["host-key"];
|
|
5284
|
+
if (proxy["host-key"]) parsedProxy.host_key = proxy["host-key"];
|
|
5338
5285
|
if (proxy["host-key-algorithms"])
|
|
5339
5286
|
parsedProxy.host_key_algorithms = proxy["host-key-algorithms"];
|
|
5340
|
-
if (proxy["fast-open"])
|
|
5341
|
-
parsedProxy.udp_fragment = true;
|
|
5287
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5342
5288
|
tfoParser(proxy, parsedProxy);
|
|
5343
5289
|
detourParser(proxy, parsedProxy);
|
|
5344
5290
|
return parsedProxy;
|
|
@@ -5353,10 +5299,8 @@ var httpParser = (proxy = {}) => {
|
|
|
5353
5299
|
};
|
|
5354
5300
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5355
5301
|
throw "invalid port";
|
|
5356
|
-
if (proxy.username)
|
|
5357
|
-
|
|
5358
|
-
if (proxy.password)
|
|
5359
|
-
parsedProxy.password = proxy.password;
|
|
5302
|
+
if (proxy.username) parsedProxy.username = proxy.username;
|
|
5303
|
+
if (proxy.password) parsedProxy.password = proxy.password;
|
|
5360
5304
|
if (proxy.headers) {
|
|
5361
5305
|
parsedProxy.headers = {};
|
|
5362
5306
|
for (const k of Object.keys(proxy.headers)) {
|
|
@@ -5365,8 +5309,7 @@ var httpParser = (proxy = {}) => {
|
|
|
5365
5309
|
if (Object.keys(parsedProxy.headers).length === 0)
|
|
5366
5310
|
delete parsedProxy.headers;
|
|
5367
5311
|
}
|
|
5368
|
-
if (proxy["fast-open"])
|
|
5369
|
-
parsedProxy.udp_fragment = true;
|
|
5312
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5370
5313
|
tfoParser(proxy, parsedProxy);
|
|
5371
5314
|
detourParser(proxy, parsedProxy);
|
|
5372
5315
|
tlsParser(proxy, parsedProxy);
|
|
@@ -5383,16 +5326,11 @@ var socks5Parser = (proxy = {}) => {
|
|
|
5383
5326
|
};
|
|
5384
5327
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5385
5328
|
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;
|
|
5329
|
+
if (proxy.username) parsedProxy.username = proxy.username;
|
|
5330
|
+
if (proxy.password) parsedProxy.password = proxy.password;
|
|
5331
|
+
if (proxy.uot) parsedProxy.udp_over_tcp = true;
|
|
5332
|
+
if (proxy["udp-over-tcp"]) parsedProxy.udp_over_tcp = true;
|
|
5333
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5396
5334
|
tfoParser(proxy, parsedProxy);
|
|
5397
5335
|
detourParser(proxy, parsedProxy);
|
|
5398
5336
|
return parsedProxy;
|
|
@@ -5423,8 +5361,7 @@ var shadowTLSParser = (proxy = {}) => {
|
|
|
5423
5361
|
};
|
|
5424
5362
|
if (stPart.server_port < 0 || stPart.server_port > 65535)
|
|
5425
5363
|
throw "\u7AEF\u53E3\u503C\u975E\u6CD5";
|
|
5426
|
-
if (proxy["fast-open"] === true)
|
|
5427
|
-
stPart.udp_fragment = true;
|
|
5364
|
+
if (proxy["fast-open"] === true) stPart.udp_fragment = true;
|
|
5428
5365
|
tfoParser(proxy, stPart);
|
|
5429
5366
|
detourParser(proxy, stPart);
|
|
5430
5367
|
smuxParser(proxy.smux, ssPart);
|
|
@@ -5441,12 +5378,9 @@ var ssParser = (proxy = {}) => {
|
|
|
5441
5378
|
};
|
|
5442
5379
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5443
5380
|
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;
|
|
5381
|
+
if (proxy.uot) parsedProxy.udp_over_tcp = true;
|
|
5382
|
+
if (proxy["udp-over-tcp"]) parsedProxy.udp_over_tcp = true;
|
|
5383
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5450
5384
|
tfoParser(proxy, parsedProxy);
|
|
5451
5385
|
detourParser(proxy, parsedProxy);
|
|
5452
5386
|
smuxParser(proxy.smux, parsedProxy);
|
|
@@ -5473,15 +5407,12 @@ var ssParser = (proxy = {}) => {
|
|
|
5473
5407
|
}
|
|
5474
5408
|
if (proxy.plugin === "v2ray-plugin") {
|
|
5475
5409
|
parsedProxy.plugin = "v2ray-plugin";
|
|
5476
|
-
if (proxy["ws-host"])
|
|
5477
|
-
|
|
5478
|
-
if (proxy["ws-path"])
|
|
5479
|
-
proxy["plugin-opts"].path = proxy["ws-path"];
|
|
5410
|
+
if (proxy["ws-host"]) proxy["plugin-opts"].host = proxy["ws-host"];
|
|
5411
|
+
if (proxy["ws-path"]) proxy["plugin-opts"].path = proxy["ws-path"];
|
|
5480
5412
|
Object.keys(proxy["plugin-opts"]).forEach((k) => {
|
|
5481
5413
|
switch (k) {
|
|
5482
5414
|
case "tls":
|
|
5483
|
-
if (proxy["plugin-opts"].tls)
|
|
5484
|
-
optArr.push("tls");
|
|
5415
|
+
if (proxy["plugin-opts"].tls) optArr.push("tls");
|
|
5485
5416
|
break;
|
|
5486
5417
|
case "host":
|
|
5487
5418
|
optArr.push(`host=${proxy["plugin-opts"].host}`);
|
|
@@ -5522,12 +5453,10 @@ var ssrParser = (proxy = {}) => {
|
|
|
5522
5453
|
};
|
|
5523
5454
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5524
5455
|
throw "invalid port";
|
|
5525
|
-
if (proxy["obfs-param"])
|
|
5526
|
-
parsedProxy.obfs_param = proxy["obfs-param"];
|
|
5456
|
+
if (proxy["obfs-param"]) parsedProxy.obfs_param = proxy["obfs-param"];
|
|
5527
5457
|
if (proxy["protocol-param"] && proxy["protocol-param"] !== "")
|
|
5528
5458
|
parsedProxy.protocol_param = proxy["protocol-param"];
|
|
5529
|
-
if (proxy["fast-open"])
|
|
5530
|
-
parsedProxy.udp_fragment = true;
|
|
5459
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5531
5460
|
tfoParser(proxy, parsedProxy);
|
|
5532
5461
|
detourParser(proxy, parsedProxy);
|
|
5533
5462
|
smuxParser(proxy.smux, parsedProxy);
|
|
@@ -5555,18 +5484,12 @@ var vmessParser = (proxy = {}) => {
|
|
|
5555
5484
|
parsedProxy.security = "auto";
|
|
5556
5485
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5557
5486
|
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);
|
|
5487
|
+
if (proxy.xudp) parsedProxy.packet_encoding = "xudp";
|
|
5488
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5489
|
+
if (proxy.network === "ws") wsParser(proxy, parsedProxy);
|
|
5490
|
+
if (proxy.network === "h2") h2Parser(proxy, parsedProxy);
|
|
5491
|
+
if (proxy.network === "http") h1Parser(proxy, parsedProxy);
|
|
5492
|
+
if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
|
|
5570
5493
|
tfoParser(proxy, parsedProxy);
|
|
5571
5494
|
detourParser(proxy, parsedProxy);
|
|
5572
5495
|
tlsParser(proxy, parsedProxy);
|
|
@@ -5584,14 +5507,10 @@ var vlessParser = (proxy = {}) => {
|
|
|
5584
5507
|
};
|
|
5585
5508
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5586
5509
|
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);
|
|
5510
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5511
|
+
if (proxy.flow === "xtls-rprx-vision") parsedProxy.flow = proxy.flow;
|
|
5512
|
+
if (proxy.network === "ws") wsParser(proxy, parsedProxy);
|
|
5513
|
+
if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
|
|
5595
5514
|
tfoParser(proxy, parsedProxy);
|
|
5596
5515
|
detourParser(proxy, parsedProxy);
|
|
5597
5516
|
smuxParser(proxy.smux, parsedProxy);
|
|
@@ -5609,12 +5528,9 @@ var trojanParser = (proxy = {}) => {
|
|
|
5609
5528
|
};
|
|
5610
5529
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5611
5530
|
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);
|
|
5531
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5532
|
+
if (proxy.network === "grpc") grpcParser(proxy, parsedProxy);
|
|
5533
|
+
if (proxy.network === "ws") wsParser(proxy, parsedProxy);
|
|
5618
5534
|
tfoParser(proxy, parsedProxy);
|
|
5619
5535
|
detourParser(proxy, parsedProxy);
|
|
5620
5536
|
tlsParser(proxy, parsedProxy);
|
|
@@ -5632,12 +5548,9 @@ var hysteriaParser = (proxy = {}) => {
|
|
|
5632
5548
|
};
|
|
5633
5549
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5634
5550
|
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;
|
|
5551
|
+
if (proxy.auth_str) parsedProxy.auth_str = `${proxy.auth_str}`;
|
|
5552
|
+
if (proxy["auth-str"]) parsedProxy.auth_str = `${proxy["auth-str"]}`;
|
|
5553
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5641
5554
|
const reg = new RegExp("^[0-9]+[ ]*[KMGT]*[Bb]ps$");
|
|
5642
5555
|
if (reg.test(`${proxy.up}`)) {
|
|
5643
5556
|
parsedProxy.up = `${proxy.up}`;
|
|
@@ -5649,16 +5562,13 @@ var hysteriaParser = (proxy = {}) => {
|
|
|
5649
5562
|
} else {
|
|
5650
5563
|
parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);
|
|
5651
5564
|
}
|
|
5652
|
-
if (proxy.obfs)
|
|
5653
|
-
parsedProxy.obfs = proxy.obfs;
|
|
5565
|
+
if (proxy.obfs) parsedProxy.obfs = proxy.obfs;
|
|
5654
5566
|
if (proxy.recv_window_conn)
|
|
5655
5567
|
parsedProxy.recv_window_conn = proxy.recv_window_conn;
|
|
5656
5568
|
if (proxy["recv-window-conn"])
|
|
5657
5569
|
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"];
|
|
5570
|
+
if (proxy.recv_window) parsedProxy.recv_window = proxy.recv_window;
|
|
5571
|
+
if (proxy["recv-window"]) parsedProxy.recv_window = proxy["recv-window"];
|
|
5662
5572
|
if (proxy.disable_mtu_discovery) {
|
|
5663
5573
|
if (typeof proxy.disable_mtu_discovery === "boolean") {
|
|
5664
5574
|
parsedProxy.disable_mtu_discovery = proxy.disable_mtu_discovery;
|
|
@@ -5685,16 +5595,12 @@ var hysteria2Parser = (proxy = {}) => {
|
|
|
5685
5595
|
};
|
|
5686
5596
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5687
5597
|
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";
|
|
5598
|
+
if (proxy.up) parsedProxy.up_mbps = parseInt(`${proxy.up}`, 10);
|
|
5599
|
+
if (proxy.down) parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);
|
|
5600
|
+
if (proxy.obfs === "salamander") parsedProxy.obfs.type = "salamander";
|
|
5694
5601
|
if (proxy["obfs-password"])
|
|
5695
5602
|
parsedProxy.obfs.password = proxy["obfs-password"];
|
|
5696
|
-
if (!parsedProxy.obfs.type)
|
|
5697
|
-
delete parsedProxy.obfs;
|
|
5603
|
+
if (!parsedProxy.obfs.type) delete parsedProxy.obfs;
|
|
5698
5604
|
tlsParser(proxy, parsedProxy);
|
|
5699
5605
|
tfoParser(proxy, parsedProxy);
|
|
5700
5606
|
detourParser(proxy, parsedProxy);
|
|
@@ -5713,16 +5619,13 @@ var tuic5Parser = (proxy = {}) => {
|
|
|
5713
5619
|
};
|
|
5714
5620
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5715
5621
|
throw "invalid port";
|
|
5716
|
-
if (proxy["fast-open"])
|
|
5717
|
-
parsedProxy.udp_fragment = true;
|
|
5622
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5718
5623
|
if (proxy["congestion-controller"] && proxy["congestion-controller"] !== "cubic")
|
|
5719
5624
|
parsedProxy.congestion_control = proxy["congestion-controller"];
|
|
5720
5625
|
if (proxy["udp-relay-mode"] && proxy["udp-relay-mode"] !== "native")
|
|
5721
5626
|
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;
|
|
5627
|
+
if (proxy["reduce-rtt"]) parsedProxy.zero_rtt_handshake = true;
|
|
5628
|
+
if (proxy["udp-over-stream"]) parsedProxy.udp_over_stream = true;
|
|
5726
5629
|
if (proxy["heartbeat-interval"])
|
|
5727
5630
|
parsedProxy.heartbeat = `${proxy["heartbeat-interval"]}ms`;
|
|
5728
5631
|
tfoParser(proxy, parsedProxy);
|
|
@@ -5733,10 +5636,8 @@ var tuic5Parser = (proxy = {}) => {
|
|
|
5733
5636
|
};
|
|
5734
5637
|
var wireguardParser = (proxy = {}) => {
|
|
5735
5638
|
const local_address = ["ip", "ipv6"].map((i) => proxy[i]).map((i) => {
|
|
5736
|
-
if (isIPv4(i))
|
|
5737
|
-
|
|
5738
|
-
if (isIPv6(i))
|
|
5739
|
-
return `${i}/128`;
|
|
5639
|
+
if (isIPv4(i)) return `${i}/32`;
|
|
5640
|
+
if (isIPv6(i)) return `${i}/128`;
|
|
5740
5641
|
}).filter((i) => i);
|
|
5741
5642
|
const parsedProxy = {
|
|
5742
5643
|
tag: proxy.name,
|
|
@@ -5751,13 +5652,11 @@ var wireguardParser = (proxy = {}) => {
|
|
|
5751
5652
|
};
|
|
5752
5653
|
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
|
|
5753
5654
|
throw "invalid port";
|
|
5754
|
-
if (proxy["fast-open"])
|
|
5755
|
-
parsedProxy.udp_fragment = true;
|
|
5655
|
+
if (proxy["fast-open"]) parsedProxy.udp_fragment = true;
|
|
5756
5656
|
if (typeof proxy.reserved === "string") {
|
|
5757
5657
|
parsedProxy.reserved = proxy.reserved;
|
|
5758
5658
|
} else if (Array.isArray(proxy.reserved)) {
|
|
5759
|
-
for (const r of proxy.reserved)
|
|
5760
|
-
parsedProxy.reserved.push(r);
|
|
5659
|
+
for (const r of proxy.reserved) parsedProxy.reserved.push(r);
|
|
5761
5660
|
} else {
|
|
5762
5661
|
delete parsedProxy.reserved;
|
|
5763
5662
|
}
|
|
@@ -5774,13 +5673,11 @@ var wireguardParser = (proxy = {}) => {
|
|
|
5774
5673
|
if (typeof p.reserved === "string") {
|
|
5775
5674
|
peer.reserved.push(p.reserved);
|
|
5776
5675
|
} else if (Array.isArray(p.reserved)) {
|
|
5777
|
-
for (const r of p.reserved)
|
|
5778
|
-
peer.reserved.push(r);
|
|
5676
|
+
for (const r of p.reserved) peer.reserved.push(r);
|
|
5779
5677
|
} else {
|
|
5780
5678
|
delete peer.reserved;
|
|
5781
5679
|
}
|
|
5782
|
-
if (p["pre-shared-key"])
|
|
5783
|
-
peer.pre_shared_key = p["pre-shared-key"];
|
|
5680
|
+
if (p["pre-shared-key"]) peer.pre_shared_key = p["pre-shared-key"];
|
|
5784
5681
|
parsedProxy.peers.push(peer);
|
|
5785
5682
|
}
|
|
5786
5683
|
}
|
|
@@ -5890,7 +5787,7 @@ function singbox_Producer() {
|
|
|
5890
5787
|
return { type, produce };
|
|
5891
5788
|
}
|
|
5892
5789
|
|
|
5893
|
-
// src/core/proxy-utils/producers/index.js
|
|
5790
|
+
// Sub-Store/backend/src/core/proxy-utils/producers/index.js
|
|
5894
5791
|
function JSON_Producer() {
|
|
5895
5792
|
const type = "ALL";
|
|
5896
5793
|
const produce = (proxies, type2) => type2 === "internal" ? proxies : JSON.stringify(proxies, null, 2);
|
|
@@ -5913,7 +5810,12 @@ var producers_default = {
|
|
|
5913
5810
|
Surfboard: Surfboard_Producer(),
|
|
5914
5811
|
"sing-box": singbox_Producer()
|
|
5915
5812
|
};
|
|
5813
|
+
|
|
5814
|
+
// src/index.js
|
|
5815
|
+
var src_default = {
|
|
5816
|
+
parsers: parsers_default,
|
|
5817
|
+
produce: producers_default
|
|
5818
|
+
};
|
|
5916
5819
|
export {
|
|
5917
|
-
|
|
5918
|
-
producers_default as produce
|
|
5820
|
+
src_default as default
|
|
5919
5821
|
};
|
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.417",
|
|
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
|
}
|