From 8b87c2ef55c6634a51f638232915129df6a0259c Mon Sep 17 00:00:00 2001 From: xream Date: Mon, 28 Aug 2023 23:40:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80=E5=B0=86=20VMess=20?= =?UTF-8?q?=E5=92=8C=20VLESS=20=E7=9A=84=20http=20=E4=BC=A0=E8=BE=93?= =?UTF-8?q?=E5=B1=82=E7=9A=84=20path=20=E5=92=8C=20Host=20=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=B8=BA=E6=95=B0=E7=BB=84?= 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 | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 5107ba4..9b0fde8 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.41", + "version": "2.14.42", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index 47a0e4d..cb66f55 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -220,6 +220,17 @@ function lastParse(proxy) { ? [proxy.server] : proxy.server; } + // 统一将 VMess 和 VLESS 的 http 传输层的 path 和 Host 处理为数组 + if (['vmess', 'vless'].includes(proxy.type) && proxy.network === 'http') { + let transportPath = proxy[`${proxy.network}-opts`]?.path; + let transportHost = proxy[`${proxy.network}-opts`]?.headers?.Host; + if (transportHost && !Array.isArray(transportHost)) { + proxy[`${proxy.network}-opts`].headers.Host = [transportHost]; + } + if (transportPath && !Array.isArray(transportPath)) { + proxy[`${proxy.network}-opts`].path = [transportPath]; + } + } return proxy; }