parent
cedddee5bc
commit
cd923c99cc
@ -130,13 +130,10 @@ function gen_outbound(flag, node, tag, proxy_table)
|
|||||||
if version_ge_1_12_0 then
|
if version_ge_1_12_0 then
|
||||||
--https://sing-box.sagernet.org/migration/#migrate-outbound-domain-strategy-option-to-domain-resolver
|
--https://sing-box.sagernet.org/migration/#migrate-outbound-domain-strategy-option-to-domain-resolver
|
||||||
result.domain_strategy = nil
|
result.domain_strategy = nil
|
||||||
if node.domain_strategy then
|
result.domain_resolver = {
|
||||||
local domain_resolver = {
|
server = "direct",
|
||||||
server = "direct",
|
strategy = (node.domain_strategy and node.domain_strategy ~="") and node.domain_strategy or nil
|
||||||
strategy = node.domain_strategy
|
}
|
||||||
}
|
|
||||||
result.domain_resolver = domain_resolver
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local tls = nil
|
local tls = nil
|
||||||
@ -1762,6 +1759,23 @@ function gen_config(var)
|
|||||||
strategy = "prefer_ipv6"
|
strategy = "prefer_ipv6"
|
||||||
}
|
}
|
||||||
direct_outbound.domain_resolver = domain_resolver
|
direct_outbound.domain_resolver = domain_resolver
|
||||||
|
-- 当没有 direct dns 服务器时添加 local
|
||||||
|
if config.dns and config.dns.servers then
|
||||||
|
for _, server in ipairs(config.dns.servers) do
|
||||||
|
if server.tag == "direct" then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
config.dns = {
|
||||||
|
servers = {
|
||||||
|
{
|
||||||
|
type = "local",
|
||||||
|
tag = "direct"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
table.insert(outbounds,direct_outbound)
|
table.insert(outbounds,direct_outbound)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user