From 486ac9c28d62c89f4f0bf0076295bcaa7563f8b3 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Thu, 28 May 2026 02:33:13 +0200 Subject: [PATCH] feat(inbounds): expose Vision testseed field with sensible default Add a "Vision testseed" form item to the inbound modal for TCP + TLS/reality inbounds, normalized to positive integers and defaulting to [900,500,900,256]. Apply the same default in the outbound form adapter when no valid saved seed is present. Replace the http/mixed snapshot assertions in inbound-defaults with explicit field checks so generated credentials don't break the snapshots. --- frontend/src/lib/xray/outbound-form-adapter.ts | 2 +- frontend/src/pages/inbounds/InboundFormModal.tsx | 15 +++++++++++++++ .../__snapshots__/inbound-defaults.test.ts.snap | 16 ---------------- frontend/src/test/inbound-defaults.test.ts | 14 ++++++++++++-- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/frontend/src/lib/xray/outbound-form-adapter.ts b/frontend/src/lib/xray/outbound-form-adapter.ts index 0b2c5bf6..86c69697 100644 --- a/frontend/src/lib/xray/outbound-form-adapter.ts +++ b/frontend/src/lib/xray/outbound-form-adapter.ts @@ -116,7 +116,7 @@ function vlessFromWire(raw: Raw): VlessOutboundFormSettings { const testseed = savedSeed.length === 4 && savedSeed.every((n) => Number.isInteger(n) && (n as number) > 0) ? (savedSeed as number[]) - : []; + : [900, 500, 900, 256]; return { address, port, diff --git a/frontend/src/pages/inbounds/InboundFormModal.tsx b/frontend/src/pages/inbounds/InboundFormModal.tsx index 484c8f6c..538d6da1 100644 --- a/frontend/src/pages/inbounds/InboundFormModal.tsx +++ b/frontend/src/pages/inbounds/InboundFormModal.tsx @@ -1428,6 +1428,21 @@ export default function InboundFormModal({ {t('pages.inbounds.vlessAuthSelected', { auth: selectedVlessAuth })} + {network === 'tcp' && (security === 'tls' || security === 'reality') && ( + + Array.isArray(v) + ? v.map((x) => Number(x)).filter((n) => Number.isInteger(n) && n > 0) + : [] + } + extra="Applies only to clients using the xtls-rprx-vision flow; ignored otherwise." + > +