diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua index 2f8cade7..0b1cbf07 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua @@ -824,17 +824,21 @@ if not load_shunt_options then if not (load_iface_options or load_urltest_options) then -- Special node cannot be use pre-proxy. o:value("1", translate("Preproxy Node")) + o:value("3", translate("Outbound Interface")) end o:value("2", translate("Landing Node")) - o:depends({ [_n("hysteria2_realms")] = false }) o1 = s:option(ListValue, _n("preproxy_node"), translate("Preproxy Node"), translate("Only support a layer of proxy.")) - o1:depends({ [_n("chain_proxy")] = "1" }) + o1:depends({ [_n("chain_proxy")] = "1", [_n("hysteria2_realms")] = false }) o1.template = appname .. "/cbi/nodes_listvalue" o1.group = {} + o3 = s:option(Value, _n("outbound_iface"), translate("Outbound Interface")) + o3.default = "eth1" + o3:depends({ [_n("chain_proxy")] = "3" }) + o2 = s:option(ListValue, _n("to_node"), translate("Landing Node"), translate("Only support a layer of proxy.")) - o2:depends({ [_n("chain_proxy")] = "2" }) + o2:depends({ [_n("chain_proxy")] = "2", [_n("hysteria2_realms")] = false }) o2.template = appname .. "/cbi/nodes_listvalue" o2.group = {} diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index d98e1905..3d428e05 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -1438,6 +1438,10 @@ function gen_config(var) end end end + if node.chain_proxy == "3" and node.outbound_iface then + outbound.detour = nil + outbound.bind_interface = node.outbound_iface + end return default_outTag, last_insert_outbound end @@ -2006,6 +2010,10 @@ function gen_config(var) } end + route.default_domain_resolver = { + server = "direct" + } + if not dns.rules then dns.rules = {} end for i, v in pairs(GLOBAL.DNS_SERVER) do @@ -2102,16 +2110,12 @@ function gen_config(var) type = "direct", tag = "direct", routing_mark = 255, - domain_resolver = { - server = "direct", - strategy = "prefer_ipv6" - } }) for index, value in ipairs(config.outbounds) do if not value["_flag_proxy_tag"] and not value.detour and value["_id"] and value.server and (value.server_port or value.server_ports) and not no_run then sys.call(string.format("echo '%s' >> %s", value["_id"], api.TMP_PATH .. "/direct_node_list")) end - if not value.detour and value.server then + if not value.detour and not value.bind_interface and value.server then value.detour = "direct" end if (value.server and not api.datatypes.hostname(value.server)) and not value.realm then diff --git a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm index 77f77c5b..86c49b14 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm @@ -874,6 +874,8 @@ table td, .table .td { p = "URLTest"; } else if (protocol == "_shunt") { p = "<%:Shunt%>"; + } else if (protocol == "_iface") { + p = "<%:Interface%>"; } else if (protocol == "vmess") { p = "VMess"; } else if (protocol == "vless") { diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index aa3f0662..237fdeae 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1924,6 +1924,9 @@ msgstr "仅支持 Xray 或 Sing-box 类型节点。" msgid "Chain Proxy" msgstr "链式代理" +msgid "Outbound Interface" +msgstr "出站接口" + msgid "Landing Node" msgstr "落地节点"