Skip to content

Commit

Permalink
Update xray.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MHSanaei committed Feb 28, 2023
1 parent 24af44c commit 44b7422
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions web/assets/js/model/xray.js
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ class Inbound extends XrayCommonClass {
return url.toString();
}

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

static fromJson(json={}) {
return new Inbound(
Expand Down

0 comments on commit 44b7422

Please sign in to comment.