From 6a8cee3cd51c3aa118083247408751c0df72868d Mon Sep 17 00:00:00 2001 From: xream Date: Sat, 17 Feb 2024 17:41:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=8A=82=E7=82=B9=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6,=20=E6=B7=BB=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=8A=82=E7=82=B9=E5=90=8D=E7=A7=B0?= 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 | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index ff849b1..df666bf 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.223", + "version": "2.14.224", "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 580d115..3859659 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -1,6 +1,6 @@ import YAML from '@/utils/yaml'; import download from '@/utils/download'; -import { isIPv4, isIPv6, isValidPortNumber } from '@/utils'; +import { isIPv4, isIPv6, isValidPortNumber, isNotBlank } from '@/utils'; import PROXY_PROCESSORS, { ApplyProcessor } from './processors'; import PROXY_PREPROCESSORS from './preprocessors'; import PROXY_PRODUCERS from './producers'; @@ -186,6 +186,13 @@ function produce(proxies, targetPlatform, type, opts = {}) { !(proxy.supported && proxy.supported[targetPlatform] === false), ); + proxies = proxies.map((proxy) => { + if (!isNotBlank(proxy.name)) { + proxy.name = `${proxy.type} ${proxy.server}:${proxy.port}`; + } + return proxy; + }); + $.info(`Producing proxies for target: ${targetPlatform}`); if (typeof producer.type === 'undefined' || producer.type === 'SINGLE') { let localPort = 10000;