luci: achieve Xray vision pre-proxy
This commit is contained in:
parent
2fc4eb5470
commit
12976f60a3
@ -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 \
|
||||
|
@ -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, {
|
||||
|
Loading…
Reference in New Issue
Block a user