Add domain prefetch, fix ping issue

This commit is contained in:
Nick Peng
2019-02-06 16:57:05 +08:00
parent f02dffdf95
commit 36ddca0491
4 changed files with 28 additions and 2 deletions

View File

@@ -67,6 +67,12 @@ msgstr "双栈IP优选"
msgid "Enable IP selection between IPV4 and IPV6"
msgstr "启用或禁用IPV4IPV6间的IP优选策略。"
msgid "Domain prefetch"
msgstr "域名预加载"
msgid "Enable domain prefetch, accelerate domain response speed."
msgstr "启用域名预加载,加速域名响应速度。"
msgid "Redirect"
msgstr "重定向"

View File

@@ -60,6 +60,14 @@ o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
---- Domain prefetch load
o = s:taboption("settings", Flag, "prefetch_domain", translate("Domain prefetch"), translate("Enable domain prefetch, accelerate domain response speed."))
o.rmempty = false
o.default = o.disabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
---- Redirect
o = s:taboption("settings", ListValue, "redirect", translate("Redirect"), translate("SmartDNS redirect mode"))
o.placeholder = "none"

View File

@@ -217,6 +217,11 @@ load_service() {
conf_append "dualstack-ip-selection" "yes"
fi
config_get "prefetch_domain" "$section" "prefetch_domain" "0"
if [ "$prefetch_domain" = "1" ]; then
conf_append "prefetch-domain" "yes"
fi
SMARTDNS_PORT="$port"
config_get "cache_size" "$section" "cache_size" ""