luci-app-mosdns: Add DoH/TCP/DoT idle timeout settings
This commit is contained in:
parent
6b22fe4cc4
commit
ec4d25516c
@ -99,6 +99,11 @@ o.datatype = "and(uinteger,min(1))"
|
|||||||
o.default = "2"
|
o.default = "2"
|
||||||
o:depends("configfile", "/etc/mosdns/config.yaml")
|
o:depends("configfile", "/etc/mosdns/config.yaml")
|
||||||
|
|
||||||
|
o = s:taboption("advanced", Value, "idle_timeout", translate("Idle Timeout"), translate("DoH/TCP/DoT Connection Multiplexing idle timeout (default 30 seconds)"))
|
||||||
|
o.datatype = "and(uinteger,min(1))"
|
||||||
|
o.default = "30"
|
||||||
|
o:depends("configfile", "/etc/mosdns/config.yaml")
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "enable_pipeline", translate("TCP/DoT Connection Multiplexing"), translate("Enable TCP/DoT RFC 7766 new Query Pipelining connection multiplexing mode"))
|
o = s:taboption("advanced", Flag, "enable_pipeline", translate("TCP/DoT Connection Multiplexing"), translate("Enable TCP/DoT RFC 7766 new Query Pipelining connection multiplexing mode"))
|
||||||
o.rmempty = false
|
o.rmempty = false
|
||||||
o.default = false
|
o.default = false
|
||||||
|
@ -154,6 +154,12 @@ msgstr "最大连接数(默认 2)"
|
|||||||
msgid "Set the Maximum connections for DoH and pipeline's TCP/DoT, Except for the HTTP/3 protocol"
|
msgid "Set the Maximum connections for DoH and pipeline's TCP/DoT, Except for the HTTP/3 protocol"
|
||||||
msgstr "设置 DoH 和已启用 Query Pipelining 连接复用模式的 TCP/DoT 最大连接数,HTTP/3 协议除外"
|
msgstr "设置 DoH 和已启用 Query Pipelining 连接复用模式的 TCP/DoT 最大连接数,HTTP/3 协议除外"
|
||||||
|
|
||||||
|
msgid "Idle Timeout"
|
||||||
|
msgstr "空闲超时"
|
||||||
|
|
||||||
|
msgid "DoH/TCP/DoT Connection Multiplexing idle timeout (default 30 seconds)"
|
||||||
|
msgstr "DoH/TCP/DoT 连接复用空闲保持时间(默认 30 秒)"
|
||||||
|
|
||||||
msgid "TCP/DoT Connection Multiplexing"
|
msgid "TCP/DoT Connection Multiplexing"
|
||||||
msgstr "TCP/DoT 连接复用"
|
msgstr "TCP/DoT 连接复用"
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ config mosdns 'config'
|
|||||||
option dump_file '0'
|
option dump_file '0'
|
||||||
option concurrent '1'
|
option concurrent '1'
|
||||||
option max_conns '2'
|
option max_conns '2'
|
||||||
|
option idle_timeout '30'
|
||||||
option minimal_ttl '0'
|
option minimal_ttl '0'
|
||||||
option maximum_ttl '0'
|
option maximum_ttl '0'
|
||||||
option custom_local_dns '0'
|
option custom_local_dns '0'
|
||||||
|
@ -58,6 +58,7 @@ get_config() {
|
|||||||
config_get concurrent $1 concurrent 1
|
config_get concurrent $1 concurrent 1
|
||||||
config_get max_conns $1 max_conns 2
|
config_get max_conns $1 max_conns 2
|
||||||
config_get insecure_skip_verify $1 insecure_skip_verify 0
|
config_get insecure_skip_verify $1 insecure_skip_verify 0
|
||||||
|
config_get idle_timeout $1 idle_timeout 30
|
||||||
}
|
}
|
||||||
|
|
||||||
init_yaml() {
|
init_yaml() {
|
||||||
@ -66,9 +67,9 @@ init_yaml() {
|
|||||||
[ $enable_pipeline -eq 1 ] && enable_pipeline=true || enable_pipeline=false
|
[ $enable_pipeline -eq 1 ] && enable_pipeline=true || enable_pipeline=false
|
||||||
[ $insecure_skip_verify -eq 1 ] && insecure_skip_verify=true || insecure_skip_verify=false
|
[ $insecure_skip_verify -eq 1 ] && insecure_skip_verify=true || insecure_skip_verify=false
|
||||||
[ "$custom_local_dns" -eq 1 ] && \
|
[ "$custom_local_dns" -eq 1 ] && \
|
||||||
local_dns=$($MOSDNS_SCRIPT dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n%s max_conns: '${max_conns}'\n%s insecure_skip_verify: '${insecure_skip_verify}'\n",s,$i,s,s,s,s}' s=' ') || \
|
local_dns=$($MOSDNS_SCRIPT dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n%s max_conns: '${max_conns}'\n%s insecure_skip_verify: '${insecure_skip_verify}'\n%s idle_timeout: '${idle_timeout}'\n",s,$i,s,s,s,s,s}' s=' ') || \
|
||||||
local_dns=$($MOSDNS_SCRIPT dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n",s,$i,s}' s=' ')
|
local_dns=$($MOSDNS_SCRIPT dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n",s,$i,s}' s=' ')
|
||||||
remote_dns=$(echo $remote_dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n%s max_conns: '${max_conns}'\n%s insecure_skip_verify: '${insecure_skip_verify}'\n",s,$i,s,s,s,s}' s=' ')
|
remote_dns=$(echo $remote_dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n%s max_conns: '${max_conns}'\n%s insecure_skip_verify: '${insecure_skip_verify}'\n%s idle_timeout: '${idle_timeout}'\n",s,$i,s,s,s,s,s}' s=' ')
|
||||||
sed "s,log_level,$log_level,g;s,log_file,$log_file,g; \
|
sed "s,log_level,$log_level,g;s,log_file,$log_file,g; \
|
||||||
s,listen_port,$listen_port,g;s,cache_size,$cache_size,g; \
|
s,listen_port,$listen_port,g;s,cache_size,$cache_size,g; \
|
||||||
s,cache_survival_time,$cache_survival_time,g; \
|
s,cache_survival_time,$cache_survival_time,g; \
|
||||||
|
Loading…
Reference in New Issue
Block a user