From 5706d4d0f3eaa5d8fb2f4905a7b5db6b58e44e69 Mon Sep 17 00:00:00 2001 From: xream Date: Mon, 23 Mar 2026 15:05:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Stash=20=E6=94=AF=E6=8C=81=20Tailscale,?= =?UTF-8?q?=20=E6=A0=B9=E6=8D=AE=E8=AF=B7=E6=B1=82=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E8=87=AA=E5=8A=A8=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E6=88=96=E4=BD=BF=E7=94=A8=20includeUnsupportedProxy=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=88=96=E5=BC=80=E5=90=AF=20=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E5=AE=98=E6=96=B9/=E5=95=86=E5=BA=97=E7=89=88?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E7=9A=84=E5=8D=8F=E8=AE=AE=20?= =?UTF-8?q?=E5=BC=80=E5=85=B3;=20=E5=8D=8F=E8=AE=AE=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20Tailscale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- backend/package.json | 2 +- backend/src/core/proxy-utils/parsers/index.js | 1 + .../src/core/proxy-utils/producers/clashmeta.js | 4 +++- .../core/proxy-utils/producers/shadowrocket.js | 1 + backend/src/core/proxy-utils/producers/stash.js | 3 +++ backend/src/utils/user-agent.js | 17 +++++++++-------- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b8032a16..f09dca24 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Core functionalities: - [x] QX (SS, SSR, VMess, Trojan, HTTP, SOCKS5, VLESS) - [x] Loon (SS, SSR, VMess, Trojan, HTTP, SOCKS5, SOCKS5-TLS, WireGuard, VLESS, Hysteria 2, AnyTLS) - [x] Surge (Direct, SS, VMess, Trojan, HTTP, SOCKS5, SOCKS5-TLS, AnyTLS, TrustTunnel, TUIC, Snell, Hysteria 2, SSH(Password authentication only), External Proxy Program(only for macOS), WireGuard(Surge to Surge)) -- [x] mihomo(Clash.Meta) Compatible (Direct, SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, Hysteria 2, TUIC, SSH, mieru, sudoku, AnyTLS, MASQUE) +- [x] mihomo(Clash.Meta) Compatible (Direct, SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, Hysteria 2, TUIC, SSH, mieru, sudoku, AnyTLS, MASQUE, Tailscale) Deprecated(The frontend doesn't show it, but the backend still supports it, with the query parameter `target=Clash`): diff --git a/backend/package.json b/backend/package.json index 660e2ff8..68219e0a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.21.53", + "version": "2.21.54", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index 74f7dd48..af4e5e9c 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -1266,6 +1266,7 @@ function Clash_All() { } if ( ![ + 'tailscale', 'trusttunnel', 'naive', 'anytls', diff --git a/backend/src/core/proxy-utils/producers/clashmeta.js b/backend/src/core/proxy-utils/producers/clashmeta.js index 2dc4a339..d42798e8 100644 --- a/backend/src/core/proxy-utils/producers/clashmeta.js +++ b/backend/src/core/proxy-utils/producers/clashmeta.js @@ -16,7 +16,9 @@ export default function ClashMeta_Producer() { if (opts['include-unsupported-proxy']) return true; if (proxy.type === 'snell' && proxy.version >= 4) { return false; - } else if (['juicity', 'naive'].includes(proxy.type)) { + } else if ( + ['tailscale', 'juicity', 'naive'].includes(proxy.type) + ) { return false; } else if ( ['ss'].includes(proxy.type) && diff --git a/backend/src/core/proxy-utils/producers/shadowrocket.js b/backend/src/core/proxy-utils/producers/shadowrocket.js index 2442013a..146919d9 100644 --- a/backend/src/core/proxy-utils/producers/shadowrocket.js +++ b/backend/src/core/proxy-utils/producers/shadowrocket.js @@ -11,6 +11,7 @@ export default function Shadowrocket_Producer() { return false; } else if ( [ + 'tailscale', 'trusttunnel', 'mieru', 'sudoku', diff --git a/backend/src/core/proxy-utils/producers/stash.js b/backend/src/core/proxy-utils/producers/stash.js index c9aaddd5..564202bf 100644 --- a/backend/src/core/proxy-utils/producers/stash.js +++ b/backend/src/core/proxy-utils/producers/stash.js @@ -24,6 +24,9 @@ export default function Stash_Producer() { 'ssh', 'juicity', 'anytls', + ...(opts['include-unsupported-proxy'] + ? ['tailscale'] + : []), ].includes(proxy.type) || (proxy.type === 'ss' && ![ diff --git a/backend/src/utils/user-agent.js b/backend/src/utils/user-agent.js index 0f6378c5..3916d0d1 100644 --- a/backend/src/utils/user-agent.js +++ b/backend/src/utils/user-agent.js @@ -66,7 +66,8 @@ export function shouldIncludeUnsupportedProxy(platform, headers) { const { UA, ua, accept } = getUserAgentFromHeaders(headers); const target = getPlatformFromUserAgent({ UA, ua, accept }); const coerceVersion = coerce(ua); - const { major } = coerceVersion; + const { major, version } = coerceVersion; + if ( (['SurgeMac', 'Surge'].includes(platform) && target === 'SurgeMac' && @@ -82,13 +83,13 @@ export function shouldIncludeUnsupportedProxy(platform, headers) { // ) { // return true; // } - // // if ( - // // platform === 'Stash' && - // // target === 'Stash' && - // // gte(version, '3.1.0') - // // ) { - // // return true; - // // } + if ( + platform === 'Stash' && + target === 'Stash' && + gte(version, '3.3.3') + ) { + return true; + } // // if ( // // platform === 'Loon' &&