From 0dc202e7c9dd45b77c107f2be9bfe36b3bb56208 Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 11 Aug 2026 19:15:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Stash=20=E6=94=AF=E6=8C=81=20MASQUE?= 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 | 5 ++++- backend/src/core/proxy-utils/producers/stash.js | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/package.json b/backend/package.json index 8a52b3c8..b7f2d758 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.36.34", + "version": "2.36.35", "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 eac7be65..95af67aa 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -1110,7 +1110,10 @@ function lastParse(proxy) { } } } - if (['ws', 'http', 'h2'].includes(proxy.network)) { + if ( + ['ws', 'http', 'h2'].includes(proxy.network) && + !['masque'].includes(proxy.type) + ) { if ( ['ws', 'h2'].includes(proxy.network) && !proxy[`${proxy.network}-opts`]?.path diff --git a/backend/src/core/proxy-utils/producers/stash.js b/backend/src/core/proxy-utils/producers/stash.js index a99e0e84..735d577a 100644 --- a/backend/src/core/proxy-utils/producers/stash.js +++ b/backend/src/core/proxy-utils/producers/stash.js @@ -36,6 +36,7 @@ export default function Stash_Producer() { 'anytls', 'tailscale', 'trusttunnel', + 'masque', ].includes(proxy.type) || (proxy.type === 'ss' && ![ @@ -262,9 +263,9 @@ export default function Stash_Producer() { proxy['h2-opts']?.headers?.host ?? proxy['h2-opts']?.headers?.Host; if ( - (isPresent(proxy, 'h2-opts.host') || - isPresent(proxy, 'h2-opts.headers.host') || - isPresent(proxy, 'h2-opts.headers.Host')) + isPresent(proxy, 'h2-opts.host') || + isPresent(proxy, 'h2-opts.headers.host') || + isPresent(proxy, 'h2-opts.headers.Host') ) { proxy['h2-opts'].host = Array.isArray(host) ? host