Skip to content

Commit

Permalink
separated inbound's client mux #257
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Oct 22, 2024
1 parent 90b2876 commit 119cff3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/Multiplex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default {
},
computed: {
mux(): oMultiplex {
if (!Object.hasOwn(this.$props.data,"multiplex")) this.$props.data.multiplex = {}
return <oMultiplex> this.$props.data.multiplex
},
muxEnable: {
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/layouts/modals/Inbound.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</v-window-item>
<v-window-item value="c">
<OutJsonVue :inData="inData" :type="inbound.type" />
<Multiplex v-if="Object.hasOwn(inbound,'multiplex')" direction="out" :data="inData.outJson" />
<v-card>
<v-card-subtitle>{{ $t('in.multiDomain') }}
<v-icon @click="add_addr" icon="mdi-plus"></v-icon>
Expand Down Expand Up @@ -169,6 +170,7 @@ export default {
const prevConfig = { tag: tag ,listen: this.inbound.listen, listen_port: this.inbound.listen_port }
this.inbound = createInbound(this.inbound.type, prevConfig)
if (this.HasInData.includes(this.inbound.type)){
if (this.inData.id == -1) this.inData.id = 0
this.inData.outJson = {}
this.inData.tag = tag
} else {
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/plugins/outJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ function addTls(out: any, tls: iTls, tlsClient: oTls){

function shadowsocksOut(out: any, inbound: Shadowsocks) {
out.method = inbound.method
out.multiplex = inbound.multiplex
}

function shadowTlsOut(out: any, inbound: ShadowTLS) {
Expand Down Expand Up @@ -94,16 +93,13 @@ function tuicOut(out: any, inbound: TUIC) {
}

function vlessOut(out: any, inbound: VLESS) {
out.multiplex = inbound.multiplex
out.transport = inbound.transport
}

function trojanOut(out: any, inbound: Trojan) {
out.multiplex = inbound.multiplex
out.transport = inbound.transport
}

function vmessOut(out: any, inbound: VMess) {
out.multiplex = inbound.multiplex
out.transport = inbound.transport
}
4 changes: 4 additions & 0 deletions frontend/src/views/Inbounds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ const delInbound = (index: number) => {
}
if (index < Data().oldData.config.inbounds.length){
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
}
Expand Down

0 comments on commit 119cff3

Please sign in to comment.