mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-20 07:00:05 +08:00
mux padding
This commit is contained in:
parent
4438c4f0e5
commit
c06df8d251
@ -30,6 +30,7 @@ import io.nekohasekai.sagernet.fmt.wireguard.buildSingBoxOutboundWireguardBean
|
|||||||
import io.nekohasekai.sagernet.ktx.isIpAddress
|
import io.nekohasekai.sagernet.ktx.isIpAddress
|
||||||
import io.nekohasekai.sagernet.ktx.mkPort
|
import io.nekohasekai.sagernet.ktx.mkPort
|
||||||
import io.nekohasekai.sagernet.utils.PackageCache
|
import io.nekohasekai.sagernet.utils.PackageCache
|
||||||
|
import moe.matsuri.nb4a.Protocols
|
||||||
import moe.matsuri.nb4a.SingBoxOptions.*
|
import moe.matsuri.nb4a.SingBoxOptions.*
|
||||||
import moe.matsuri.nb4a.applyDNSNetworkSettings
|
import moe.matsuri.nb4a.applyDNSNetworkSettings
|
||||||
import moe.matsuri.nb4a.checkEmpty
|
import moe.matsuri.nb4a.checkEmpty
|
||||||
@ -400,6 +401,7 @@ fun buildConfig(
|
|||||||
muxApplied = true
|
muxApplied = true
|
||||||
currentOutbound["multiplex"] = MultiplexOptions().apply {
|
currentOutbound["multiplex"] = MultiplexOptions().apply {
|
||||||
enabled = true
|
enabled = true
|
||||||
|
padding = Protocols.shouldEnableMux("padding")
|
||||||
max_streams = DataStore.muxConcurrency
|
max_streams = DataStore.muxConcurrency
|
||||||
protocol = when (DataStore.muxType) {
|
protocol = when (DataStore.muxType) {
|
||||||
1 -> "smux"
|
1 -> "smux"
|
||||||
|
|||||||
@ -29,7 +29,7 @@ object Protocols {
|
|||||||
|
|
||||||
fun getCanMuxList(): List<String> {
|
fun getCanMuxList(): List<String> {
|
||||||
// built-in and support mux
|
// built-in and support mux
|
||||||
val list = mutableListOf("vmess", "trojan", "trojan-go", "shadowsocks", "vless")
|
val list = mutableListOf("vmess", "trojan", "trojan-go", "shadowsocks", "vless", "padding")
|
||||||
|
|
||||||
NekoPluginManager.getProtocols().forEach {
|
NekoPluginManager.getProtocols().forEach {
|
||||||
if (it.protocolConfig.optBoolean("canMux")) {
|
if (it.protocolConfig.optBoolean("canMux")) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user