diff --git a/backend/package.json b/backend/package.json index 9468a03..a80605e 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.286", + "version": "2.14.287", "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/sing-box.js b/backend/src/core/proxy-utils/producers/sing-box.js index f1c83d1..65fc528 100644 --- a/backend/src/core/proxy-utils/producers/sing-box.js +++ b/backend/src/core/proxy-utils/producers/sing-box.js @@ -1,5 +1,6 @@ import ClashMeta_Producer from './clashmeta'; import $ from '@/core/app'; +import { isIPv4, isIPv6 } from '@/utils'; const detourParser = (proxy, parsedProxy) => { if (proxy['dialer-proxy']) parsedProxy.detour = proxy['dialer-proxy']; @@ -620,8 +621,11 @@ const tuic5Parser = (proxy = {}) => { const wireguardParser = (proxy = {}) => { const local_address = ['ip', 'ipv6'] .map((i) => proxy[i]) - .filter((i) => i) - .map((i) => (/\\/.test(i) ? i : `${i}/32`)); + .map((i) => { + if (isIPv4(i)) return `${i}/32`; + if (isIPv6(i)) return `${i}/128`; + }) + .filter((i) => i); const parsedProxy = { tag: proxy.name, type: 'wireguard',