From 9c78b87834fee62a8a0da0de56fd4fbfa9345a8e Mon Sep 17 00:00:00 2001 From: xream Date: Mon, 13 Nov 2023 18:49:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=BC=E5=AE=B9=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E7=9A=84=20Trojan=20URI(=E9=A6=96=E4=B8=AA?= =?UTF-8?q?=20#=20=E4=B9=8B=E5=90=8E=E7=9A=84=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E5=9D=87=E8=A7=86=E4=B8=BA=E8=8A=82=E7=82=B9=E5=90=8D=E7=A7=B0?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/parsers/index.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 1e15b47..db5c93c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.86", + "version": "2.14.87", "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 7213f05..0fc899e 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -463,8 +463,16 @@ function URI_Trojan() { }; const parse = (line) => { + let [newLine, name] = line.split(/#(.+)/, 2); const parser = getTrojanURIParser(); - const proxy = parser.parse(line); + const proxy = parser.parse(newLine); + if (isNotBlank(name)) { + try { + proxy.name = decodeURIComponent(name); + } catch (e) { + console.log(e); + } + } return proxy; }; return { name, test, parse };