From ba78982f4150c3940678753da3f16a697155982e 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 | 4 ++-- backend/src/core/proxy-utils/index.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 5107ba4..ea93a2e 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": { @@ -10,7 +10,7 @@ "start": "nodemon -w src -w package.json --exec babel-node src/main.js", "build": "gulp", "bundle": "node bundle.js", - "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s" + "changelog": "conventional-changelog -p cli -i CHANGELOG.md -s" }, "author": "Peng-YM", "license": "GPL-3.0", 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; }