Skip to content

Commit 37f9755

Browse files
lwb1978handsomeji
andcommitted
luci: optimize and fix
部分同步:Openwrt-Passwall/openwrt-passwall2@223dba9 Co-Authored-By: handsomeji <60100640+handsomeji@users.noreply.github.com>
1 parent 4add69d commit 37f9755

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

luci-app-passwall/luasrc/passwall/util_sing-box.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,9 @@ function gen_config(var)
18131813
table.insert(dns.rules, {
18141814
query_type = { "A", "AAAA" },
18151815
server = fakedns_tag,
1816-
disable_cache = true
1816+
disable_cache = true,
1817+
rewrite_ttl = 30,
1818+
strategy = remote_strategy
18171819
})
18181820
end
18191821
end

luci-app-passwall/luasrc/passwall/util_xray.lua

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,14 +1047,25 @@ function gen_config(var)
10471047
else
10481048
local preproxy_node = get_node_by_id(node.preproxy_node)
10491049
if preproxy_node then
1050-
local preproxy_outbound = gen_outbound(node[".name"], preproxy_node)
1050+
local preproxy_outbound, exist
1051+
if preproxy_node.protocol == "_balancing" then
1052+
local balancer_tag, loopback_outbound = gen_balancer(preproxy_node)
1053+
if loopback_outbound then
1054+
preproxy_outbound = loopback_outbound
1055+
exist = true
1056+
end
1057+
else
1058+
preproxy_outbound = gen_outbound(node[".name"], preproxy_node)
1059+
end
10511060
if preproxy_outbound then
10521061
outbound.tag = preproxy_outbound.tag .. " -> " .. outbound.tag
10531062
outbound.proxySettings = {
10541063
tag = preproxy_outbound.tag,
10551064
transportLayer = true
10561065
}
1057-
last_insert_outbound = preproxy_outbound
1066+
if not exist then
1067+
last_insert_outbound = preproxy_outbound
1068+
end
10581069
default_outTag = outbound.tag
10591070
end
10601071
end

0 commit comments

Comments
 (0)