expand multiDomain to externalProxy #637

- Including non-tls inbounds
- Support forcedTLS/none/same security
- Change port is possible
- Move it to standard streamSettings
- Optimizing database
This commit is contained in:
Alireza Ahmadi
2023-11-29 03:01:59 +01:00
parent 3eae6300e7
commit 5546883799
15 changed files with 198 additions and 234 deletions

View File

@@ -42,15 +42,6 @@
loading(loading) {
inModal.confirmLoading = loading;
},
getClients(protocol, clientSettings) {
switch(protocol){
case Protocols.VMESS: return clientSettings.vmesses;
case Protocols.VLESS: return clientSettings.vlesses;
case Protocols.TROJAN: return clientSettings.trojans;
case Protocols.SHADOWSOCKS: return clientSettings.shadowsockses;
default: return null;
}
},
};
new Vue({
@@ -69,7 +60,7 @@
return inModal.isEdit;
},
get client() {
return inModal.getClients(this.inbound.protocol, this.inbound.settings)[0];
return inModal.inbound.clients[0];
},
get delayedExpireDays() {
return this.client && this.client.expiryTime < 0 ? this.client.expiryTime / -86400000 : 0;
@@ -77,16 +68,18 @@
set delayedExpireDays(days){
this.client.expiryTime = -86400000 * days;
},
get multiDomain() {
return this.inbound.stream.tls.settings.domains.length > 0;
get externalProxy() {
return this.inbound.stream.externalProxy.length > 0;
},
set multiDomain(value) {
set externalProxy(value) {
if (value) {
inModal.inbound.stream.tls.server = "";
inModal.inbound.stream.tls.settings.domains = [{ remark: "", domain: window.location.hostname }];
inModal.inbound.stream.externalProxy = [{
forceTls: "same",
dest: window.location.hostname + ":" + inModal.inbound.port,
remark: ""
}];
} else {
inModal.inbound.stream.tls.server = "";
inModal.inbound.stream.tls.settings.domains = [];
inModal.inbound.stream.externalProxy = [];
}
}
},