From 1e3b4a147a707d03ac075e30d27355155b29ee87 Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 21 Nov 2023 19:58:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=AD=97=E6=AE=B5=201.=20no-resolve,=20=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E8=B7=B3=E8=BF=87=E5=9F=9F=E5=90=8D=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=202.=20resolved=20=E7=94=A8=E6=9D=A5=E6=A0=87?= =?UTF-8?q?=E8=AE=B0=E5=9F=9F=E5=90=8D=E8=A7=A3=E6=9E=90=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/processors/index.js | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/backend/package.json b/backend/package.json index 276602e41..a642bd3f2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.97", + "version": "2.14.99", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/processors/index.js b/backend/src/core/proxy-utils/processors/index.js index 7b89dc725..1257bc2ac 100644 --- a/backend/src/core/proxy-utils/processors/index.js +++ b/backend/src/core/proxy-utils/processors/index.js @@ -451,7 +451,9 @@ function ResolveDomainOperator({ provider }) { const limit = 15; // more than 20 concurrency may result in surge TCP connection shortage. const totalDomain = [ ...new Set( - proxies.filter((p) => !isIP(p.server)).map((c) => c.server), + proxies + .filter((p) => !isIP(p.server) && !p['no-resolve']) + .map((c) => c.server), ), ]; const totalBatch = Math.ceil(totalDomain.length / limit); @@ -475,8 +477,15 @@ function ResolveDomainOperator({ provider }) { } await Promise.all(currentBatch); } - proxies.forEach((proxy) => { - proxy.server = results[proxy.server] || proxy.server; + proxies.forEach((p) => { + if (!p['no-resolve']) { + if (results[p.server]) { + p.server = results[p.server]; + p.resolved = true; + } else { + p.resolved = false; + } + } }); return proxies;