diff --git a/backend/package.json b/backend/package.json index 6b8a4f997..f6836f533 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.352", + "version": "2.14.353", "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/v2ray.js b/backend/src/core/proxy-utils/producers/v2ray.js index be3370ae8..bdb3c68d5 100644 --- a/backend/src/core/proxy-utils/producers/v2ray.js +++ b/backend/src/core/proxy-utils/producers/v2ray.js @@ -1,12 +1,30 @@ /* eslint-disable no-case-declarations */ import { Base64 } from 'js-base64'; import URI_Producer from './uri'; +import $ from '@/core/app'; const URI = URI_Producer(); export default function V2Ray_Producer() { const type = 'ALL'; - const produce = (proxies) => - Base64.encode(proxies.map((proxy) => URI.produce(proxy)).join('\n')); + const produce = (proxies) => { + let result = []; + proxies.map((proxy) => { + try { + result.push(URI.produce(proxy)); + } catch (err) { + $.error( + `Cannot produce proxy: ${JSON.stringify( + proxy, + null, + 2, + )}\nReason: ${err}`, + ); + } + }); + + return Base64.encode(result.join('\n')); + }; + return { type, produce }; }