From 9568f4d6d97042b83df4b85224aad9e4c1877c16 Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 25 Mar 2025 23:58:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97,?= =?UTF-8?q?=20Loon=20=E8=A7=A3=E6=9E=90=E5=99=A8=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/producers/loon.js | 7 +++++-- backend/src/products/resource-parser.loon.js | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/package.json b/backend/package.json index 4d89865..0b46b8c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.19.7", + "version": "2.19.8", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/producers/loon.js b/backend/src/core/proxy-utils/producers/loon.js index 7126f85..d454317 100644 --- a/backend/src/core/proxy-utils/producers/loon.js +++ b/backend/src/core/proxy-utils/producers/loon.js @@ -361,10 +361,12 @@ function vless(proxy, includeUnsupportedProxy) { ['xtls-rprx-vision'].includes(proxy.flow) ) { isReality = true; - } else if (proxy['reality-opts'] || proxy.flow) { + } else if (proxy['reality-opts']) { throw new Error( - `VLESS XTLS/REALITY with flow(${proxy.flow}) is not supported`, + `VLESS REALITY with flow(${proxy.flow}) is not supported`, ); + } else if (proxy.flow) { + throw new Error(`VLESS XTLS is not supported`); } } const result = new Result(proxy); @@ -416,6 +418,7 @@ function vless(proxy, includeUnsupportedProxy) { // sni if (isReality) { + result.appendIfPresent(`,flow=${proxy.flow}`, 'flow'); result.appendIfPresent(`,sni=${proxy.sni}`, 'sni'); result.appendIfPresent( `,public-key="${proxy['reality-opts']['public-key']}"`, diff --git a/backend/src/products/resource-parser.loon.js b/backend/src/products/resource-parser.loon.js index d373f1e..33ed296 100644 --- a/backend/src/products/resource-parser.loon.js +++ b/backend/src/products/resource-parser.loon.js @@ -14,10 +14,12 @@ let resourceUrl = typeof $resourceUrl !== 'undefined' ? $resourceUrl : ''; ` ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ Sub-Store -- v${version} + Loon -- ${$loon} ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ `, ); + const build = $loon.match(/\((\d+)\)$/)?.[1]; let arg; if (typeof $argument != 'undefined') { arg = Object.fromEntries( @@ -38,7 +40,8 @@ let resourceUrl = typeof $resourceUrl !== 'undefined' ? $resourceUrl : ''; try { let proxies = ProxyUtils.parse(resource); result = ProxyUtils.produce(proxies, 'Loon', undefined, { - 'include-unsupported-proxy': arg?.includeUnsupportedProxy, + 'include-unsupported-proxy': + arg?.includeUnsupportedProxy || build >= 838, }); } catch (e) { console.log('解析器: 使用 resource 出现错误');