Fix mux enabled
This commit is contained in:
@@ -401,17 +401,35 @@ object V2rayConfigUtil {
|
|||||||
|
|
||||||
private fun updateOutboundWithGlobalSettings(outbound: V2rayConfig.OutboundBean): Boolean {
|
private fun updateOutboundWithGlobalSettings(outbound: V2rayConfig.OutboundBean): Boolean {
|
||||||
try {
|
try {
|
||||||
if (settingsStorage?.decodeBool(AppConfig.PREF_MUX_ENABLED) == true) {
|
var muxEnabled = settingsStorage?.decodeBool(AppConfig.PREF_MUX_ENABLED, false)
|
||||||
|
|
||||||
|
val protocol = outbound.protocol
|
||||||
|
if (protocol.equals(EConfigType.SHADOWSOCKS.name, true)
|
||||||
|
|| protocol.equals(EConfigType.SOCKS.name, true)
|
||||||
|
|| protocol.equals(EConfigType.TROJAN.name, true)
|
||||||
|
) {
|
||||||
|
muxEnabled = false
|
||||||
|
} else if (protocol.equals(EConfigType.VLESS.name, true)
|
||||||
|
&& outbound.settings?.vnext?.get(0)?.users?.get(0)?.flow?.isNotEmpty() == true
|
||||||
|
) {
|
||||||
|
muxEnabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (muxEnabled == true) {
|
||||||
outbound.mux?.enabled = true
|
outbound.mux?.enabled = true
|
||||||
outbound.mux?.concurrency = 8
|
outbound.mux?.concurrency = 8
|
||||||
outbound.mux?.xudpConcurrency = settingsStorage?.decodeInt(AppConfig.PREF_MUX_XUDP_CONCURRENCY) ?: 8
|
outbound.mux?.xudpConcurrency =
|
||||||
outbound.mux?.xudpProxyUDP443 = settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject"
|
settingsStorage?.decodeInt(AppConfig.PREF_MUX_XUDP_CONCURRENCY) ?: 8
|
||||||
|
outbound.mux?.xudpProxyUDP443 =
|
||||||
|
settingsStorage?.decodeString(AppConfig.PREF_MUX_XUDP_QUIC) ?: "reject"
|
||||||
} else {
|
} else {
|
||||||
outbound.mux?.enabled = false
|
outbound.mux?.enabled = false
|
||||||
|
outbound.mux?.concurrency = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outbound.streamSettings?.network == DEFAULT_NETWORK
|
if (outbound.streamSettings?.network == DEFAULT_NETWORK
|
||||||
&& outbound.streamSettings?.tcpSettings?.header?.type == HTTP) {
|
&& outbound.streamSettings?.tcpSettings?.header?.type == HTTP
|
||||||
|
) {
|
||||||
val path = outbound.streamSettings?.tcpSettings?.header?.request?.path
|
val path = outbound.streamSettings?.tcpSettings?.header?.request?.path
|
||||||
val host = outbound.streamSettings?.tcpSettings?.header?.request?.headers?.Host
|
val host = outbound.streamSettings?.tcpSettings?.header?.request?.headers?.Host
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
<string name="summary_pref_per_app_proxy">常规:勾选的App被代理,未勾选的直连;\n绕行模式:勾选的App直连,未勾选的被代理.\n不明白者在菜单中选择自动选中需代理应用</string>
|
<string name="summary_pref_per_app_proxy">常规:勾选的App被代理,未勾选的直连;\n绕行模式:勾选的App直连,未勾选的被代理.\n不明白者在菜单中选择自动选中需代理应用</string>
|
||||||
|
|
||||||
<string name="title_pref_mux_enabled">启用 Mux 多路复用</string>
|
<string name="title_pref_mux_enabled">启用 Mux 多路复用</string>
|
||||||
<string name="summary_pref_mux_enabled">减低延时 但可能会断流\nTCP 默认复用 8 个子链接,UDP 及 QUIC 流量处理方式下方可选</string>
|
<string name="summary_pref_mux_enabled">减低延时,但可能会断流,建议不要启用。\nTCP 默认复用 8 个子链接,UDP 及 QUIC 流量处理方式下方可选。</string>
|
||||||
<string name="title_pref_mux_xudp_concurency">XUDP 复用子链接数(可填 -1 至 1024)</string>
|
<string name="title_pref_mux_xudp_concurency">XUDP 复用子链接数(可填 -1 至 1024)</string>
|
||||||
<string name="title_pref_mux_xudp_quic">QUIC 流量处理方式</string>
|
<string name="title_pref_mux_xudp_quic">QUIC 流量处理方式</string>
|
||||||
<string-array name="mux_xudp_quic_entries">
|
<string-array name="mux_xudp_quic_entries">
|
||||||
|
|||||||
Reference in New Issue
Block a user