separated inbound's client mux #257

This commit is contained in:
Alireza Ahmadi
2024-10-22 23:55:37 +02:00
parent 90b2876867
commit 119cff3d85
4 changed files with 7 additions and 4 deletions
+1
View File
@@ -85,6 +85,7 @@ export default {
}, },
computed: { computed: {
mux(): oMultiplex { mux(): oMultiplex {
if (!Object.hasOwn(this.$props.data,"multiplex")) this.$props.data.multiplex = {}
return <oMultiplex> this.$props.data.multiplex return <oMultiplex> this.$props.data.multiplex
}, },
muxEnable: { muxEnable: {
+2
View File
@@ -50,6 +50,7 @@
</v-window-item> </v-window-item>
<v-window-item value="c"> <v-window-item value="c">
<OutJsonVue :inData="inData" :type="inbound.type" /> <OutJsonVue :inData="inData" :type="inbound.type" />
<Multiplex v-if="Object.hasOwn(inbound,'multiplex')" direction="out" :data="inData.outJson" />
<v-card> <v-card>
<v-card-subtitle>{{ $t('in.multiDomain') }} <v-card-subtitle>{{ $t('in.multiDomain') }}
<v-icon @click="add_addr" icon="mdi-plus"></v-icon> <v-icon @click="add_addr" icon="mdi-plus"></v-icon>
@@ -169,6 +170,7 @@ export default {
const prevConfig = { tag: tag ,listen: this.inbound.listen, listen_port: this.inbound.listen_port } const prevConfig = { tag: tag ,listen: this.inbound.listen, listen_port: this.inbound.listen_port }
this.inbound = createInbound(this.inbound.type, prevConfig) this.inbound = createInbound(this.inbound.type, prevConfig)
if (this.HasInData.includes(this.inbound.type)){ if (this.HasInData.includes(this.inbound.type)){
if (this.inData.id == -1) this.inData.id = 0
this.inData.outJson = {} this.inData.outJson = {}
this.inData.tag = tag this.inData.tag = tag
} else { } else {
-4
View File
@@ -61,7 +61,6 @@ function addTls(out: any, tls: iTls, tlsClient: oTls){
function shadowsocksOut(out: any, inbound: Shadowsocks) { function shadowsocksOut(out: any, inbound: Shadowsocks) {
out.method = inbound.method out.method = inbound.method
out.multiplex = inbound.multiplex
} }
function shadowTlsOut(out: any, inbound: ShadowTLS) { function shadowTlsOut(out: any, inbound: ShadowTLS) {
@@ -94,16 +93,13 @@ function tuicOut(out: any, inbound: TUIC) {
} }
function vlessOut(out: any, inbound: VLESS) { function vlessOut(out: any, inbound: VLESS) {
out.multiplex = inbound.multiplex
out.transport = inbound.transport out.transport = inbound.transport
} }
function trojanOut(out: any, inbound: Trojan) { function trojanOut(out: any, inbound: Trojan) {
out.multiplex = inbound.multiplex
out.transport = inbound.transport out.transport = inbound.transport
} }
function vmessOut(out: any, inbound: VMess) { function vmessOut(out: any, inbound: VMess) {
out.multiplex = inbound.multiplex
out.transport = inbound.transport out.transport = inbound.transport
} }
+4
View File
@@ -311,6 +311,10 @@ const delInbound = (index: number) => {
} }
if (index < Data().oldData.config.inbounds.length){ if (index < Data().oldData.config.inbounds.length){
Data().delInbound(index) Data().delInbound(index)
} else {
// Delete new inbound's inData if exists
const inDataIndex = Data().inData.findIndex((d:any) => d.tag == tag)
if (inDataIndex != -1) Data().inData.splice(inDataIndex, 1)
} }
delOverlay.value[index] = false delOverlay.value[index] = false
} }