From aa0943a9091100643fb450668d1a009b46027cb0 Mon Sep 17 00:00:00 2001 From: xream Date: Thu, 18 Jul 2024 19:47:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A2=AB=E8=AF=86=E5=88=AB=E4=B8=BA=20I?= =?UTF-8?q?P4P=20=E7=9A=84=E5=9F=9F=E5=90=8D=E8=A7=A3=E6=9E=90=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=9D=87=E5=A2=9E=E5=8A=A0=20=5FIP4P=20=E5=AD=97?= =?UTF-8?q?=E6=AE=B5;=20=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99?= 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 | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/package.json b/backend/package.json index dfdae60..52db704 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.350", + "version": "2.14.351", "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 20f833c..0ecdace 100644 --- a/backend/src/core/proxy-utils/processors/index.js +++ b/backend/src/core/proxy-utils/processors/index.js @@ -627,8 +627,15 @@ function ResolveDomainOperator({ ] : results[p.server]; if (type === 'IPv6' && isIPv6(ip)) { - ip = new ipAddress.Address6(ip).correctForm(); + try { + ip = new ipAddress.Address6(ip).correctForm(); + } catch (e) { + $.error( + `Failed to parse IPv6 address: ${ip}: ${e}`, + ); + } if (/^2001::[^:]+:[^:]+:[^:]+$/.test(ip)) { + p._IP4P = ip; const { server, port } = parseIP4P(ip); if (server && port) { p._domain = p.server; @@ -636,7 +643,6 @@ function ResolveDomainOperator({ p.port = port; p.resolved = true; p._IPv4 = p.server; - p._IP4P = ip; if (!isIP(p._IP)) { p._IP = p.server; }