From fa4193eb8a0ce3034244e2f1f90173ae3c33de85 Mon Sep 17 00:00:00 2001 From: xream Date: Sat, 18 Jul 2026 12:22:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=20AnyTLS=20=E7=9A=84?= =?UTF-8?q?=20`disable-reuse`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/index.js | 3 +++ backend/src/core/proxy-utils/producers/clashmeta.js | 7 +++++++ backend/src/core/proxy-utils/producers/shadowrocket.js | 7 +++++++ backend/src/core/proxy-utils/producers/sing-box.js | 3 +++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index f4f78cd0..423038a0 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.36.8", + "version": "2.36.9", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "packageManager": "pnpm@11.0.9", diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index 4fdfbf3f..d44e61ec 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -1039,6 +1039,9 @@ function lastParse(proxy) { proxy[`${proxy.network}-opts`].path = ['/']; } } + if (['anytls'].includes(proxy.type) && proxy['disable-reuse']) { + proxy.reuse = false; + } if (['', 'off'].includes(proxy.sni)) { proxy['disable-sni'] = true; } diff --git a/backend/src/core/proxy-utils/producers/clashmeta.js b/backend/src/core/proxy-utils/producers/clashmeta.js index b39bb6c1..031689ad 100644 --- a/backend/src/core/proxy-utils/producers/clashmeta.js +++ b/backend/src/core/proxy-utils/producers/clashmeta.js @@ -252,6 +252,13 @@ export default function ClashMeta_Producer() { ds['reality-opts'] = { 'public-key': '' }; } } + } else if ( + ['anytls'].includes(proxy.type) && + proxy.reuse != null && + !proxy.reuse + ) { + proxy['disable-reuse'] = true; + delete proxy.reuse; } if (isPresent(proxy, 'plugin-opts.mux')) { diff --git a/backend/src/core/proxy-utils/producers/shadowrocket.js b/backend/src/core/proxy-utils/producers/shadowrocket.js index ff8e4afb..8c80bb3c 100644 --- a/backend/src/core/proxy-utils/producers/shadowrocket.js +++ b/backend/src/core/proxy-utils/producers/shadowrocket.js @@ -170,6 +170,13 @@ export default function Shadowrocket_Producer() { // delete proxy.sni; } } + } else if ( + ['anytls'].includes(proxy.type) && + proxy.reuse != null && + !proxy.reuse + ) { + proxy['disable-reuse'] = true; + delete proxy.reuse; } if ( diff --git a/backend/src/core/proxy-utils/producers/sing-box.js b/backend/src/core/proxy-utils/producers/sing-box.js index d7ef8589..64aff3d1 100644 --- a/backend/src/core/proxy-utils/producers/sing-box.js +++ b/backend/src/core/proxy-utils/producers/sing-box.js @@ -1132,6 +1132,9 @@ const anytlsParser = (proxy = {}) => { `${proxy['min-idle-session']}`, 10, ); + if (proxy['disable-reuse'] != null) { + parsedProxy.disable_reuse = !!proxy['disable-reuse']; + } detourParser(proxy, parsedProxy); tlsParser(proxy, parsedProxy); ipVersionParser(proxy, parsedProxy);