Update xray.js

This commit is contained in:
MHSanaei 2023-03-01 00:42:08 +03:30
parent 24af44ca6c
commit 44b74224ab

View File

@ -1227,7 +1227,7 @@ class Inbound extends XrayCommonClass {
return url.toString(); return url.toString();
} }
genLink(address='', remark='', clientIndex=0) { genLink(address='', remark='') {
switch (this.protocol) { switch (this.protocol) {
case Protocols.VMESS: case Protocols.VMESS:
if (this.settings.vmesses[clientIndex].email != ""){ if (this.settings.vmesses[clientIndex].email != ""){
@ -1249,21 +1249,20 @@ class Inbound extends XrayCommonClass {
} }
} }
genInboundLinks(address = '', remark = '') { genInboundLinks(address = '', remark = '') {
let link = ''; let link = '';
JSON.parse(this.settings) switch (this.protocol) {
switch (this.protocol) { case Protocols.VMESS:
case Protocols.VMESS: case Protocols.VLESS:
case Protocols.VLESS: case Protocols.TROJAN:
case Protocols.TROJAN: JSON.parse(this.settings).clients.forEach((_,index) => {
JSON.parse(this.settings).clients.forEach((client,index) => { link += this.genLink(address, remark, index) + '\r\n';
link += this.genLink(address, remark, index) + '\r\n'; });
}); return link;
return link; case Protocols.SHADOWSOCKS:
case Protocols.SHADOWSOCKS: return (this.genSSLink(address, remark) + '\r\n');
return (this.genSSLink(address, remark) + '\r\n'); default: return '';
default: return ''; }
} }
}
static fromJson(json={}) { static fromJson(json={}) {
return new Inbound( return new Inbound(