From c0f1a926e588303051a6a3e977ed2948e6dfd764 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Wed, 14 Jun 2023 17:06:56 +0330 Subject: update - security "none" security set to none when tls, reality, xtls are not set its because when there is no security none on trojan link some app like v2rayn set tls for your config --- web/assets/js/model/xray.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'web') diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 12857d64..64931758 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -1358,7 +1358,7 @@ class Inbound extends XrayCommonClass { } } - if (this.xtls) { + else if (this.xtls) { params.set("security", "xtls"); params.set("alpn", this.stream.xtls.alpn); if(this.stream.xtls.settings.allowInsecure){ @@ -1373,7 +1373,7 @@ class Inbound extends XrayCommonClass { params.set("flow", this.settings.vlesses[clientIndex].flow); } - if (this.reality) { + else if (this.reality) { params.set("security", "reality"); params.set("fp", this.stream.reality.settings.fingerprint); params.set("pbk", this.stream.reality.settings.publicKey); @@ -1394,6 +1394,10 @@ class Inbound extends XrayCommonClass { } } + else { + params.set("security", "none"); + } + const link = `vless://${uuid}@${address}:${port}`; const url = new URL(link); for (const [key, value] of params) { @@ -1479,7 +1483,7 @@ class Inbound extends XrayCommonClass { } } - if (this.reality) { + else if (this.reality) { params.set("security", "reality"); params.set("fp", this.stream.reality.settings.fingerprint); params.set("pbk", this.stream.reality.settings.publicKey); @@ -1497,7 +1501,7 @@ class Inbound extends XrayCommonClass { } } - if (this.xtls) { + else if (this.xtls) { params.set("security", "xtls"); params.set("alpn", this.stream.xtls.alpn); if(this.stream.xtls.settings.allowInsecure){ @@ -1512,6 +1516,10 @@ class Inbound extends XrayCommonClass { params.set("flow", this.settings.trojans[clientIndex].flow); } + else { + params.set("security", "none"); + } + const link = `trojan://${settings.trojans[clientIndex].password}@${address}:${this.port}`; const url = new URL(link); for (const [key, value] of params) { -- cgit v1.2.3