diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index 1bf087c50..3f8c7522f 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=4.60 -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \ diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 39b0438c9..571bed856 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -33,14 +33,6 @@ local function get_domain_excluded() end function gen_outbound(flag, node, tag, proxy_table) - local proxy = 0 - local proxy_tag = "nil" - local dialerProxy = nil - if proxy_table ~= nil and type(proxy_table) == "table" then - proxy = proxy_table.proxy or 0 - proxy_tag = proxy_table.tag or "nil" - dialerProxy = proxy_table.dialerProxy - end local result = nil if node and node ~= "nil" then local node_id = node[".name"] @@ -48,20 +40,32 @@ function gen_outbound(flag, node, tag, proxy_table) tag = node_id end + local proxy = 0 + local proxy_tag = "nil" + local dialerProxy = nil + if proxy_table ~= nil and type(proxy_table) == "table" then + proxy = proxy_table.proxy or 0 + proxy_tag = proxy_table.tag or "nil" + dialerProxy = proxy_table.dialerProxy + end + if node.type == "V2ray" or node.type == "Xray" then - proxy = 0 - if proxy_tag ~= "nil" then - if dialerProxy and dialerProxy == "1" then - node.streamSettings = { - sockopt = { - dialerProxy = proxy_tag + if node.type == "Xray" and node.tlsflow == "xtls-rprx-vision" then + else + proxy = 0 + if proxy_tag ~= "nil" then + if dialerProxy and dialerProxy == "1" then + node.streamSettings = { + sockopt = { + dialerProxy = proxy_tag + } } - } - else - node.proxySettings = { - tag = proxy_tag, - transportLayer = true - } + else + node.proxySettings = { + tag = proxy_tag, + transportLayer = true + } + end end end end @@ -96,7 +100,9 @@ function gen_outbound(flag, node, tag, proxy_table) node.port = new_port end node.stream_security = "none" - else + end + + if node.type == "V2ray" or node.type == "Xray" then if node.tls and node.tls == "1" then node.stream_security = "tls" if node.type == "Xray" and node.reality and node.reality == "1" then @@ -611,7 +617,14 @@ function gen_config(var) table.insert(outbounds, main_node_outbound) proxy = 1 proxy_tag = "main" + local pre_proxy = nil if default_node.type ~= "V2ray" and default_node.type ~= "Xray" then + pre_proxy = true + end + if default_node.type == "Xray" and default_node.tlsflow == "xtls-rprx-vision" then + pre_proxy = true + end + if pre_proxy then proxy_tag = nil new_port = get_new_port() table.insert(inbounds, { @@ -672,7 +685,14 @@ function gen_config(var) table.insert(outbounds, new_outbound) outboundTag = name else + local pre_proxy = nil if _node.type ~= "V2ray" and _node.type ~= "Xray" then + pre_proxy = true + end + if _node.type == "Xray" and _node.tlsflow == "xtls-rprx-vision" then + pre_proxy = true + end + if pre_proxy then if proxy_tag ~= "nil" then new_port = get_new_port() table.insert(inbounds, {