Skip to content

Commit

Permalink
limit mux to connection base outbounds
Browse files Browse the repository at this point in the history
Co-Authored-By: Alireza Ahmadi <[email protected]>
  • Loading branch information
MHSanaei and alireza0 committed Mar 12, 2024
1 parent e43601a commit b042f01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
4 changes: 4 additions & 0 deletions web/assets/js/model/outbound.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ class Outbound extends CommonClass {
return [Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(this.protocol);
}

canEnableMux() {
return [Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks, Protocols.HTTP, Protocols.Socks].includes(this.protocol);
}

hasVnext() {
return [Protocols.VMess, Protocols.VLESS].includes(this.protocol);
}
Expand Down
30 changes: 16 additions & 14 deletions web/html/xui/form/outbound.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,21 +429,23 @@
</template>

<!-- mux settings -->
<a-form-item label="Mux">
<a-switch v-model="outbound.mux.enabled"></a-switch>
</a-form-item>
<template v-if="outbound.mux.enabled">
<a-form-item label="Concurrency">
<a-input-number v-model="outbound.mux.concurrency" :min="-1" :max="1024"></a-input-number>
</a-form-item>
<a-form-item label="xudp Concurrency">
<a-input-number v-model="outbound.mux.xudpConcurrency" :min="-1" :max="1024"></a-input-number>
</a-form-item>
<a-form-item label="xudp UDP 443">
<a-select v-model="outbound.mux.xudpProxyUDP443" :dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option v-for="c in ['reject', 'allow', 'skip']" :value="c">[[ c ]]</a-select-option>
</a-select>
<template v-if="outbound.canEnableMux()">
<a-form-item label="Mux">
<a-switch v-model="outbound.mux.enabled"></a-switch>
</a-form-item>
<template v-if="outbound.mux.enabled">
<a-form-item label="Concurrency">
<a-input-number v-model="outbound.mux.concurrency" :min="-1" :max="1024"></a-input-number>
</a-form-item>
<a-form-item label="xudp Concurrency">
<a-input-number v-model="outbound.mux.xudpConcurrency" :min="-1" :max="1024"></a-input-number>
</a-form-item>
<a-form-item label="xudp UDP 443">
<a-select v-model="outbound.mux.xudpProxyUDP443" :dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option v-for="c in ['reject', 'allow', 'skip']" :value="c">[[ c ]]</a-select-option>
</a-select>
</a-form-item>
</template>
</template>

</a-form>
Expand Down

0 comments on commit b042f01

Please sign in to comment.