Add menu options for Mux

This commit is contained in:
yuhan6665 committed 2023-11-05 23:16:01 -05:00
1 parent bde37e38a7
commit 23e9d7fde5
14 files changed
+168 -45

No files matched your search

@@ -64,7 +64,7 @@ object V2rayConfigUtil {
inbounds(v2rayConfig)
httpRequestObject(outbound)
updateOutboundWithGlobalSettings(outbound)
v2rayConfig.outbounds[0] = outbound
@@ -399,8 +399,17 @@ object V2rayConfigUtil {
return true
}
private fun httpRequestObject(outbound: V2rayConfig.OutboundBean): Boolean {
private fun updateOutboundWithGlobalSettings(outbound: V2rayConfig.OutboundBean): Boolean {
try {
if (settingsStorage?.decodeBool(AppConfig.PREF_MUX_ENABLED) == true) {
outbound.mux?.enabled = true
outbound.mux?.concurrency = 8
outbound.mux?.xudpConcurrency = settingsStorage?.decodeInt(AppConfig.PREF_MUX_XUDP_CONCURRENCY) ?: 8
outbound.mux?.xudpProxyUDP443 = settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject"
} else {
outbound.mux?.enabled = false
}
if (outbound.streamSettings?.network == DEFAULT_NETWORK
&& outbound.streamSettings?.tcpSettings?.header?.type == HTTP) {
val path = outbound.streamSettings?.tcpSettings?.header?.request?.path