Sync 2024-11-20 00:32

This commit is contained in:
github-actions[bot] 2024-11-20 00:32:01 +08:00
parent c1f9cbf008
commit 19e220f9a2
5 changed files with 61 additions and 25 deletions

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=24.11.18
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \

View File

@ -267,7 +267,8 @@ function gen_outbound(flag, node, tag, proxy_table)
level = 0,
security = (node.protocol == "vmess") and node.security or nil,
encryption = node.encryption or "none",
flow = (node.protocol == "vless" and node.tls == "1" and node.transport == "raw" and node.flow and node.flow ~= "") and node.flow or nil
flow = (node.protocol == "vless" and node.tls == "1" and (node.transport == "raw" or node.transport == "tcp") and node.flow and node.flow ~= "") and node.flow or nil
}
}
}

View File

@ -264,7 +264,8 @@ function gen_outbound(flag, node, tag, proxy_table)
level = 0,
security = (node.protocol == "vmess") and node.security or nil,
encryption = node.encryption or "none",
flow = (node.protocol == "vless" and node.tls == "1" and node.transport == "raw" and node.flow and node.flow ~= "") and node.flow or nil
flow = (node.protocol == "vless" and node.tls == "1" and (node.transport == "raw" or node.transport == "tcp") and node.flow and node.flow ~= "") and node.flow or nil
}
}
}

View File

@ -794,6 +794,11 @@ local api = require "luci.passwall2.api"
queryParam.type = "mkcp"
if (queryParam.type === "h2" || queryParam.type === "http")
queryParam.type = "h2"
if (dom_prefix == "singbox_" && queryParam.type === "raw") {
queryParam.type = "tcp";
} else if (dom_prefix == "xray_" && queryParam.type === "tcp") {
queryParam.type = "raw";
}
opt.set(dom_prefix + 'transport', queryParam.type);
if (queryParam.type === "raw" || queryParam.type === "tcp") {
opt.set(dom_prefix + 'tcp_guise', queryParam.headerType || "none");
@ -833,7 +838,7 @@ local api = require "luci.passwall2.api"
opt.set(dom_prefix + 'mkcp_guise', queryParam.headerType || "none");
} else if (queryParam.type === "grpc") {
opt.set(dom_prefix + 'grpc_serviceName', (queryParam.serviceName || queryParam.path) || "");
opt.set(dom_prefix + 'grpc_mode', queryParam.mode);
opt.set(dom_prefix + 'grpc_mode', queryParam.mode || "gun");
}
}
} else {
@ -903,6 +908,11 @@ local api = require "luci.passwall2.api"
queryParam.type = "mkcp"
if (queryParam.type === "h2" || queryParam.type === "http")
queryParam.type = "h2"
if (dom_prefix == "singbox_" && queryParam.type === "raw") {
queryParam.type = "tcp";
} else if (dom_prefix == "xray_" && queryParam.type === "tcp") {
queryParam.type = "raw";
}
opt.set(dom_prefix + 'transport', queryParam.type);
if (queryParam.type === "raw" || queryParam.type === "tcp") {
opt.set(dom_prefix + 'tcp_guise', queryParam.headerType || "none");
@ -942,7 +952,7 @@ local api = require "luci.passwall2.api"
opt.set(dom_prefix + 'mkcp_guise', queryParam.headerType || "none");
} else if (queryParam.type === "grpc") {
opt.set(dom_prefix + 'grpc_serviceName', (queryParam.serviceName || queryParam.path) || "");
opt.set(dom_prefix + 'grpc_mode', queryParam.mode);
opt.set(dom_prefix + 'grpc_mode', queryParam.mode || "gun");
}
opt.set(dom_prefix + 'mux', queryParam.mux === '1');
@ -983,8 +993,13 @@ local api = require "luci.passwall2.api"
ssm.net = ssm.net.toLowerCase();
if (ssm.net === "kcp" || ssm.net === "mkcp")
ssm.net = "mkcp"
if (dom_prefix == "singbox_" && ssm.net === "raw") {
ssm.net = "tcp";
} else if (dom_prefix == "xray_" && ssm.net === "tcp") {
ssm.net = "raw";
}
opt.set(dom_prefix + 'transport', ssm.net);
if (ssm.net === "raw") {
if (ssm.net === "raw" || ssm.net === "tcp") {
opt.set(dom_prefix + 'tcp_guise', (ssm.host && ssm.path) ? "http" : "none");
if (ssm.host && ssm.path) {
opt.set(dom_prefix + 'tcp_guise_http_host', ssm.host);
@ -1091,6 +1106,11 @@ local api = require "luci.passwall2.api"
queryParam.type = "mkcp"
if (queryParam.type === "h2" || queryParam.type === "http")
queryParam.type = "h2"
if (dom_prefix == "singbox_" && queryParam.type === "raw") {
queryParam.type = "tcp";
} else if (dom_prefix == "xray_" && queryParam.type === "tcp") {
queryParam.type = "raw";
}
opt.set(dom_prefix + 'transport', queryParam.type);
if (queryParam.type === "raw" || queryParam.type === "tcp") {
opt.set(dom_prefix + 'tcp_guise', queryParam.headerType || "none");
@ -1130,7 +1150,7 @@ local api = require "luci.passwall2.api"
opt.set(dom_prefix + 'mkcp_guise', queryParam.headerType || "none");
} else if (queryParam.type === "grpc") {
opt.set(dom_prefix + 'grpc_serviceName', (queryParam.serviceName || queryParam.path) || "");
opt.set(dom_prefix + 'grpc_mode', queryParam.mode);
opt.set(dom_prefix + 'grpc_mode', queryParam.mode || "gun");
} else if (queryParam.type === "xhttp" || queryParam.type === "splithttp") {
opt.set(dom_prefix + 'xhttp_host', queryParam.host || "");
opt.set(dom_prefix + 'xhttp_path', queryParam.path || "");

View File

@ -428,10 +428,13 @@ local function processData(szType, content, add_mode, add_from)
-- result.mux = 1
-- result.mux_concurrency = 8
if not info.net then
info.net = "tcp"
end
if not info.net then info.net = "tcp" end
info.net = string.lower(info.net)
if result.type == "sing-box" and info.net == "raw" then
info.net = "tcp"
elseif result.type == "Xray" and info.net == "tcp" then
info.net = "raw"
end
result.transport = info.net
if info.net == 'ws' then
result.ws_host = info.host
@ -495,7 +498,7 @@ local function processData(szType, content, add_mode, add_from)
result.tls = "0"
end
if result.type == "sing-box" and (result.transport == "mkcp" or result.transport == "xhttp" or result.transport == "raw" or result.transport == "splithttp") then
if result.type == "sing-box" and (result.transport == "mkcp" or result.transport == "xhttp" or result.transport == "splithttp") then
log("跳过节点:" .. result.remarks .."因Sing-Box不支持" .. szType .. "协议的" .. result.transport .. "传输方式需更换Xray。")
return nil
end
@ -582,7 +585,7 @@ local function processData(szType, content, add_mode, add_from)
if ss_type_default == "xray" and has_xray then
result.type = 'Xray'
result.protocol = 'shadowsocks'
result.transport = 'tcp'
result.transport = 'raw'
end
if ss_type_default == "sing-box" and has_singbox then
result.type = 'sing-box'
@ -623,6 +626,11 @@ local function processData(szType, content, add_mode, add_from)
if params.type then
params.type = string.lower(params.type)
if result.type == "sing-box" and params.type == "raw" then
params.type = "tcp"
elseif result.type == "Xray" and params.type == "tcp" then
params.type = "raw"
end
result.transport = params.type
if result.type ~= "SS-Rust" and result.type ~= "SS" then
if params.type == 'ws' then
@ -679,7 +687,7 @@ local function processData(szType, content, add_mode, add_from)
if params.type == 'grpc' then
if params.path then result.grpc_serviceName = params.path end
if params.serviceName then result.grpc_serviceName = params.serviceName end
result.grpc_mode = params.mode
result.grpc_mode = params.mode or "gun"
end
result.tls = "0"
if params.security == "tls" or params.security == "reality" then
@ -767,10 +775,13 @@ local function processData(szType, content, add_mode, add_from)
result.tls_allowInsecure = allowInsecure_default and "1" or "0"
end
if not params.type then
params.type = "tcp"
end
if not params.type then params.type = "tcp" end
params.type = string.lower(params.type)
if result.type == "sing-box" and params.type == "raw" then
params.type = "tcp"
elseif result.type == "Xray" and params.type == "tcp" then
params.type = "raw"
end
result.transport = params.type
if params.type == 'ws' then
result.ws_host = params.host
@ -826,9 +837,9 @@ local function processData(szType, content, add_mode, add_from)
if params.type == 'grpc' then
if params.path then result.grpc_serviceName = params.path end
if params.serviceName then result.grpc_serviceName = params.serviceName end
result.grpc_mode = params.mode
result.grpc_mode = params.mode or "gun"
end
if info.net == 'xhttp' or info.net == 'splithttp' then
if params.type == 'xhttp' or params.type == 'splithttp' then
result.xhttp_host = params.host
result.xhttp_path = params.path
end
@ -837,7 +848,7 @@ local function processData(szType, content, add_mode, add_from)
result.flow = params.flow or nil
if result.type == "sing-box" and (result.transport == "mkcp" or result.transport == "xhttp" or result.transport == "raw" or result.transport == "splithttp") then
if result.type == "sing-box" and (result.transport == "mkcp" or result.transport == "xhttp" or result.transport == "splithttp") then
log("跳过节点:" .. result.remarks .."因Sing-Box不支持" .. szType .. "协议的" .. result.transport .. "传输方式需更换Xray。")
return nil
end
@ -899,10 +910,13 @@ local function processData(szType, content, add_mode, add_from)
result.address = host_port
end
if not params.type then
params.type = "tcp"
end
if not params.type then params.type = "tcp" end
params.type = string.lower(params.type)
if result.type == "sing-box" and params.type == "raw" then
params.type = "tcp"
elseif result.type == "Xray" and params.type == "tcp" then
params.type = "raw"
end
result.transport = params.type
if params.type == 'ws' then
result.ws_host = params.host
@ -957,9 +971,9 @@ local function processData(szType, content, add_mode, add_from)
if params.type == 'grpc' then
if params.path then result.grpc_serviceName = params.path end
if params.serviceName then result.grpc_serviceName = params.serviceName end
result.grpc_mode = params.mode
result.grpc_mode = params.mode or "gun"
end
if info.net == 'xhttp' or info.net == 'splithttp' then
if params.type == 'xhttp' or params.type == 'splithttp' then
result.xhttp_host = params.host
result.xhttp_path = params.path
end
@ -985,7 +999,7 @@ local function processData(szType, content, add_mode, add_from)
result.port = port
result.tls_allowInsecure = allowInsecure_default and "1" or "0"
if result.type == "sing-box" and (result.transport == "mkcp" or result.transport == "xhttp" or result.transport == "raw" or result.transport == "splithttp") then
if result.type == "sing-box" and (result.transport == "mkcp" or result.transport == "xhttp" or result.transport == "splithttp") then
log("跳过节点:" .. result.remarks .."因Sing-Box不支持" .. szType .. "协议的" .. result.transport .. "传输方式需更换Xray。")
return nil
end