diff --git a/README.md b/README.md index b5bcb643..c33eda77 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ docker build -t x-ui . - Search within all inbounds and clients - Support Dark/Light theme UI - Support multi-user multi-protocol, web page visualization operation +- Support multi-domain configuration and multi-certificate inbounds - Supported protocols: vmess, vless, trojan, shadowsocks, dokodemo-door, socks, http - Support for configuring more transport configurations - Traffic statistics, limit traffic, limit expiration time diff --git a/web/assets/js/model/models.js b/web/assets/js/model/models.js index d7fc7981..21bd5567 100644 --- a/web/assets/js/model/models.js +++ b/web/assets/js/model/models.js @@ -151,9 +151,9 @@ class DBInbound { } } - genLink(clientIndex) { + genLink(address=this.address, remark=this.remark, clientIndex=0) { const inbound = this.toInbound(); - return inbound.genLink(this.address, this.remark, clientIndex); + return inbound.genLink(address, remark, clientIndex); } get genInboundLinks() { diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 5f111a99..678d7d9d 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -494,7 +494,7 @@ class TlsStreamSettings extends XrayCommonClass { } if (!ObjectUtil.isEmpty(json.settings)) { - settings = new TlsStreamSettings.Settings(json.settings.allowInsecure , json.settings.fingerprint, json.settings.serverName); + settings = new TlsStreamSettings.Settings(json.settings.allowInsecure , json.settings.fingerprint, json.settings.serverName, json.settings.domains); } return new TlsStreamSettings( json.serverName, @@ -562,17 +562,19 @@ TlsStreamSettings.Cert = class extends XrayCommonClass { }; TlsStreamSettings.Settings = class extends XrayCommonClass { - constructor(allowInsecure = false, fingerprint = '', serverName = '') { + constructor(allowInsecure = false, fingerprint = '', serverName = '', domains = []) { super(); this.allowInsecure = allowInsecure; this.fingerprint = fingerprint; this.serverName = serverName; + this.domains = domains; } static fromJson(json = {}) { return new TlsStreamSettings.Settings( json.allowInsecure, json.fingerprint, - json.servername, + json.serverName, + json.domains, ); } toJson() { @@ -580,6 +582,7 @@ TlsStreamSettings.Settings = class extends XrayCommonClass { allowInsecure: this.allowInsecure, fingerprint: this.fingerprint, serverName: this.serverName, + domains: this.domains, }; } }; @@ -1380,24 +1383,12 @@ class Inbound extends XrayCommonClass { genLink(address='', remark='', clientIndex=0) { switch (this.protocol) { case Protocols.VMESS: - if (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 - } return this.genVLESSLink(address, remark, clientIndex); case Protocols.SHADOWSOCKS: - if (this.settings.shadowsockses[clientIndex].email != ""){ - remark = this.settings.shadowsockses[clientIndex].email - } return this.genSSLink(address, remark, clientIndex); case Protocols.TROJAN: - if (this.settings.trojans[clientIndex].email != ""){ - remark = this.settings.trojans[clientIndex].email - } return this.genTrojanLink(address, remark, clientIndex); default: return ''; } @@ -1409,12 +1400,17 @@ class Inbound extends XrayCommonClass { case Protocols.VMESS: case Protocols.VLESS: case Protocols.TROJAN: - JSON.parse(this.settings).clients.forEach((_,index) => { - link += this.genLink(address, remark, index) + '\r\n'; + case Protocols.SHADOWSOCKS: + JSON.parse(this.settings).clients.forEach((client,index) => { + if(this.tls && !ObjectUtil.isArrEmpty(this.stream.tls.settings.domains)){ + this.stream.tls.settings.domains.forEach((domain) => { + link += this.genLink(domain.domain, remark + '-' + client.email + '-' + domain.remark, index) + '\r\n'; + }); + } else { + link += this.genLink(address, remark + '-' + client.email, index) + '\r\n'; + } }); return link; - case Protocols.SHADOWSOCKS: - return (this.genSSLink(address, remark) + '\r\n'); default: return ''; } } diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index 76ab7b41..58c29453 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -4,48 +4,54 @@ :class="themeSwitcher.darkCardClass" :footer="null" width="300px"> - - {{ i18n "pages.inbounds.email" }}: "[[ qrModal.clientName ]]" - - {{ i18n "pages.inbounds.clickOnQRcode" }} + + {{ i18n "pages.inbounds.client" }} + diff --git a/web/html/xui/form/tls_settings.html b/web/html/xui/form/tls_settings.html index eb1304c1..229a59b3 100644 --- a/web/html/xui/form/tls_settings.html +++ b/web/html/xui/form/tls_settings.html @@ -65,6 +65,27 @@ + Multi Domain + + + + + + + + + + + + + + + + + + + {{ i18n "domainName" }} diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index 22064b34..33937537 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -175,10 +175,14 @@
URL -

[[ infoModal.link ]]

- + + [[ link.remark ]]
[[ link.link ]]
+ + + +