Skip to content

Commit bff467f

Browse files
committed
feat: 调整 AnyTLS 不同情况下的过滤逻辑(暂时先不扩展到 所有的 REALITY 的检测)
1 parent 58ab0a7 commit bff467f

7 files changed

Lines changed: 2030 additions & 1478 deletions

File tree

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.22.28",
3+
"version": "2.22.29",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"packageManager": "pnpm@11.0.9",

backend/pnpm-lock.yaml

Lines changed: 2001 additions & 1464 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
allowBuilds:
22
core-js: true
33
esbuild: true
4+
nodemon: true

backend/src/core/proxy-utils/producers/loon.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ export default function Loon_Producer() {
2929
return shadowsocksr(proxy);
3030
case 'trojan':
3131
return trojan(proxy);
32-
case 'anytls':
33-
return anytls(proxy);
3432
case 'vmess':
3533
return vmess(proxy, opts['include-unsupported-proxy']);
3634
case 'vless':
@@ -44,6 +42,19 @@ export default function Loon_Producer() {
4442
case 'hysteria2':
4543
return hysteria2(proxy);
4644
}
45+
if (proxy.type === 'anytls') {
46+
if (
47+
proxy.network &&
48+
(!['tcp'].includes(proxy.network) ||
49+
(['tcp'].includes(proxy.network) && proxy['reality-opts']))
50+
) {
51+
throw new Error(
52+
`Platform ${targetPlatform} does not support proxy type ${proxy.type} with network or REALITY`,
53+
);
54+
}
55+
56+
return anytls(proxy);
57+
}
4758
throw new Error(
4859
`Platform ${targetPlatform} does not support proxy type: ${proxy.type}`,
4960
);

backend/src/core/proxy-utils/producers/shadowrocket.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ export default function Shadowrocket_Producer() {
3939
].includes(proxy.type)
4040
) {
4141
return false;
42-
} else if (
43-
['anytls'].includes(proxy.type) &&
44-
proxy.network &&
45-
(!['tcp'].includes(proxy.network) ||
46-
(['tcp'].includes(proxy.network) &&
47-
proxy['reality-opts']))
48-
) {
49-
return false;
5042
} else if (['xhttp'].includes(proxy.network)) {
5143
$.warn(
5244
`VLESS XHTTP 结构复杂, Shadowrocket 可能无法完全兼容`,

backend/src/core/proxy-utils/producers/surfboard.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,24 @@ export default function Surfboard_Producer() {
2828
return snell(proxy);
2929
case 'socks5':
3030
return socks5(proxy);
31-
case 'anytls':
32-
return anytls(proxy);
3331
case 'hysteria2':
3432
return hysteria2(proxy);
3533
case 'wireguard-surge':
3634
return wireguard(proxy);
3735
}
36+
if (proxy.type === 'anytls') {
37+
if (
38+
proxy.network &&
39+
(!['tcp'].includes(proxy.network) ||
40+
(['tcp'].includes(proxy.network) && proxy['reality-opts']))
41+
) {
42+
throw new Error(
43+
`Platform ${targetPlatform} does not support proxy type ${proxy.type} with network or REALITY`,
44+
);
45+
}
46+
47+
return anytls(proxy);
48+
}
3849
throw new Error(
3950
`Platform ${targetPlatform} does not support proxy type: ${proxy.type}`,
4051
);

backend/src/core/proxy-utils/producers/surge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default function Surge_Producer() {
7474
(['tcp'].includes(proxy.network) && proxy['reality-opts']))
7575
) {
7676
throw unsupported(
77-
`Platform ${targetPlatform} does not support proxy type ${proxy.type} with network or reality`,
77+
`Platform ${targetPlatform} does not support proxy type ${proxy.type} with network or REALITY`,
7878
);
7979
}
8080

0 commit comments

Comments
 (0)