diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-03-17 19:07:49 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-03-17 19:07:49 +0300 |
| commit | 96786c94189f3d2f3f04c1915529c786228bdf42 (patch) | |
| tree | 879085e09a3cd485f3246f46be907fe77eb84a1a /web/assets/js/model/xray.js | |
| parent | bc56e637376142c370c31b17558fc3778a863bd2 (diff) | |
alireza
Diffstat (limited to 'web/assets/js/model/xray.js')
| -rw-r--r-- | web/assets/js/model/xray.js | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index be689618..74418712 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -794,18 +794,6 @@ class Inbound extends XrayCommonClass { return this.network === "http"; } - isInboundEmpty() { - if (this.protocol == Protocols.VMESS && this.settings.vmesses.length == 0) { - return true; - } else if (this.protocol == Protocols.VLESS && this.settings.vlesses.length == 0) { - return true; - } else if (this.protocol == Protocols.TROJAN && this.settings.trojans.length == 0) { - return true; - } else { - return false; - } - } - // VMess & VLess get uuid() { switch (this.protocol) { @@ -1170,23 +1158,19 @@ class Inbound extends XrayCommonClass { else{ params.set("sni", address); } - if (type === "tcp") { + if (type === "tcp" && this.settings.vlesses[clientIndex].flow.length > 0) { params.set("flow", this.settings.vlesses[clientIndex].flow); } } } - if (this.stream.security === 'xtls') { - if (!ObjectUtil.isEmpty(this.stream.tls.server)) { - address = this.stream.tls.server; - if (this.stream.tls.settings[0]['serverName'] !== ''){ - params.set("sni", this.stream.tls.settings[0]['serverName']); - } - else{ - params.set("sni", address); - } - if (type === "tcp") { - params.set("flow", this.settings.vlesses[clientIndex].flow); + if (this.xtls) { + if (this.stream.security === 'xtls') { + if (!ObjectUtil.isEmpty(this.stream.tls.server)) { + address = this.stream.tls.server; + if (type === "tcp") { + params.set("flow", this.settings.vlesses[clientIndex].flow); + } } } } @@ -1281,13 +1265,7 @@ class Inbound extends XrayCommonClass { if (this.stream.security === 'xtls') { if (!ObjectUtil.isEmpty(this.stream.tls.server)) { address = this.stream.tls.server; - if (this.stream.tls.settings[0]['serverName'] !== ''){ - params.set("sni", this.stream.tls.settings[0]['serverName']); - } - else{ - params.set("sni", address); - } - if (type === "tcp") { + if (type === "tcp" && this.settings.trojans[clientIndex].flow.length > 0) { params.set("flow", this.settings.trojans[clientIndex].flow); } } @@ -1306,18 +1284,18 @@ class Inbound extends XrayCommonClass { switch (this.protocol) { case Protocols.VMESS: if (this.settings.vmesses[clientIndex].email != ""){ - remark += '-' + this.settings.vmesses[clientIndex].email + remark = this.settings.vmesses[clientIndex].email } return this.genVmessLink(address, remark, clientIndex); case Protocols.VLESS: if (this.settings.vlesses[clientIndex].email != ""){ - remark += '-' + this.settings.vlesses[clientIndex].email + remark = this.settings.vlesses[clientIndex].email } return this.genVLESSLink(address, remark, clientIndex); case Protocols.SHADOWSOCKS: return this.genSSLink(address, remark); case Protocols.TROJAN: if (this.settings.trojans[clientIndex].email != ""){ - remark += '-' + this.settings.trojans[clientIndex].email + remark = this.settings.trojans[clientIndex].email } return this.genTrojanLink(address, remark, clientIndex); default: return ''; @@ -1652,7 +1630,7 @@ Inbound.TrojanSettings = class extends Inbound.Settings { } }; Inbound.TrojanSettings.Trojan = class extends XrayCommonClass { - constructor(password=RandomUtil.randomSeq(10), flow ='', email=RandomUtil.randomText(),limitIp=0, totalGB=0, expiryTime='') { + constructor(password=RandomUtil.randomSeq(10), flow='', email=RandomUtil.randomText(),limitIp=0, totalGB=0, expiryTime='') { super(); this.password = password; this.flow = flow; @@ -1779,11 +1757,12 @@ Inbound.ShadowsocksSettings = class extends Inbound.Settings { }; Inbound.DokodemoSettings = class extends Inbound.Settings { - constructor(protocol, address, port, network='tcp,udp') { + constructor(protocol, address, port, network='tcp,udp', followRedirect=false) { super(protocol); this.address = address; this.port = port; this.network = network; + this.followRedirect = followRedirect; } static fromJson(json={}) { @@ -1792,6 +1771,7 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { json.address, json.port, json.network, + json.followRedirect, ); } @@ -1800,6 +1780,7 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { address: this.address, port: this.port, network: this.network, + followRedirect: this.followRedirect, }; } }; |
