From 737300b14b382a36a7bbd7d0d3ad94d019da5ada Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 10 May 2026 23:06:28 +0200 Subject: [PATCH] fix(outbound): default VLESS encryption to "none" A blank encryption field caused Xray to reject the outbound config with 'VLESS users: please add/set "encryption":"none"'. Default the constructor parameter, coerce empty values, and final-guard toJson so every code path emits a valid encryption value. --- frontend/src/models/outbound.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/models/outbound.js b/frontend/src/models/outbound.js index b6ed8df2..f2cabf3e 100644 --- a/frontend/src/models/outbound.js +++ b/frontend/src/models/outbound.js @@ -1926,13 +1926,13 @@ Outbound.VmessSettings = class extends CommonClass { } }; Outbound.VLESSSettings = class extends CommonClass { - constructor(address, port, id, flow, encryption, reverseTag = '', reverseSniffing = new ReverseSniffing(), testpre = 0, testseed = []) { + constructor(address, port, id, flow, encryption = 'none', reverseTag = '', reverseSniffing = new ReverseSniffing(), testpre = 0, testseed = []) { super(); this.address = address; this.port = port; this.id = id; this.flow = flow; - this.encryption = encryption; + this.encryption = encryption || 'none'; this.reverseTag = reverseTag; this.reverseSniffing = reverseSniffing; this.testpre = testpre; @@ -1966,7 +1966,7 @@ Outbound.VLESSSettings = class extends CommonClass { port: this.port, id: this.id, flow: this.flow, - encryption: this.encryption, + encryption: this.encryption || 'none', }; if (!ObjectUtil.isEmpty(this.reverseTag)) { const reverseSniffing = this.reverseSniffing ? this.reverseSniffing.toJson() : {};