mirror of
https://github.com/roacn/openwrt-packages.git
synced 2025-01-08 11:57:31 +08:00
🎈 Sync 2024-01-14 00:25
This commit is contained in:
parent
15082cdd33
commit
c4cbcd6674
@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall2
|
||||
PKG_VERSION:=1.23-2
|
||||
PKG_VERSION:=1.23-3
|
||||
PKG_RELEASE:=
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
@ -286,8 +286,6 @@ function gen_outbound(flag, node, tag, proxy_table)
|
||||
|
||||
if node.protocol == "hysteria" then
|
||||
protocol_table = {
|
||||
up = node.hysteria_up_mbps .. " Mbps",
|
||||
down = node.hysteria_down_mbps .. " Mbps",
|
||||
up_mbps = tonumber(node.hysteria_up_mbps),
|
||||
down_mbps = tonumber(node.hysteria_down_mbps),
|
||||
obfs = node.hysteria_obfs,
|
||||
|
@ -880,6 +880,11 @@ local api = require "luci.passwall2.api"
|
||||
|
||||
if (ssu[0] === "hysteria2" || ssu[0] === "hy2") {
|
||||
var m = parseNodeUrl(ssrurl);
|
||||
var password = m.passwd;
|
||||
if (password === "") {
|
||||
s.innerHTML = "<font color='red'><%:Invalid Share URL Format%></font>";
|
||||
return false;
|
||||
}
|
||||
var queryParam = {};
|
||||
if (m.search.length > 1) {
|
||||
var query = m.search.split('?');
|
||||
@ -891,21 +896,23 @@ local api = require "luci.passwall2.api"
|
||||
queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || '');
|
||||
}
|
||||
}
|
||||
opt.set('type', stype);
|
||||
|
||||
if (has_singbox) {
|
||||
opt.set('type', "sing-box");
|
||||
dom_prefix = "singbox_"
|
||||
opt.set(dom_prefix + 'protocol', "hysteria2");
|
||||
opt.set(dom_prefix + 'hysteria2_obfs_type', "salamander");
|
||||
opt.set(dom_prefix + 'hysteria2_obfs_password', queryParam["obfs-password"]);
|
||||
opt.set(dom_prefix + 'hysteria2_auth_password', queryParam.auth);
|
||||
opt.set(dom_prefix + 'hysteria2_auth_password', decodeURIComponent(password));
|
||||
if (queryParam["obfs-password"]) {
|
||||
opt.set(dom_prefix + 'hysteria2_obfs_type', "salamander");
|
||||
opt.set(dom_prefix + 'hysteria2_obfs_password', queryParam["obfs-password"]);
|
||||
}
|
||||
}
|
||||
if (has_hysteria2) {
|
||||
opt.set('type', "Hysteria2");
|
||||
dom_prefix = "hysteria2_"
|
||||
opt.set(dom_prefix + 'obfs', queryParam["obfs-password"]);
|
||||
opt.set(dom_prefix + 'auth_password', queryParam.auth);
|
||||
opt.set(dom_prefix + 'auth_password', decodeURIComponent(password));
|
||||
if (queryParam["obfs-password"]) {
|
||||
opt.set(dom_prefix + 'obfs', queryParam["obfs-password"]);
|
||||
}
|
||||
if (queryParam.pinSHA256) {
|
||||
opt.set(dom_prefix + 'tls_pinSHA256', queryParam.pinSHA256);
|
||||
}
|
||||
|
@ -772,15 +772,18 @@ local function processData(szType, content, add_mode, add_from)
|
||||
content = content:sub(0, idx_sp - 1)
|
||||
end
|
||||
result.remarks = UrlDecode(alias)
|
||||
|
||||
local dat = split(content, '%?')
|
||||
local host_port = dat[1]
|
||||
local Info = content
|
||||
if content:find("@") then
|
||||
local contents = split(content, "@")
|
||||
result.hysteria2_auth_password = UrlDecode(contents[1])
|
||||
Info = (contents[2] or ""):gsub("/%?", "?")
|
||||
end
|
||||
local query = split(Info, "?")
|
||||
local host_port = query[1]
|
||||
local params = {}
|
||||
for _, v in pairs(split(dat[2], '&')) do
|
||||
for _, v in pairs(split(query[2], '&')) do
|
||||
local t = split(v, '=')
|
||||
if #t > 0 then
|
||||
params[t[1]] = t[2]
|
||||
end
|
||||
params[string.lower(t[1])] = UrlDecode(t[2])
|
||||
end
|
||||
-- [2001:4860:4860::8888]:443
|
||||
-- 8.8.8.8:443
|
||||
@ -795,7 +798,6 @@ local function processData(szType, content, add_mode, add_from)
|
||||
else
|
||||
result.address = host_port
|
||||
end
|
||||
result.hysteria2_auth_password = params.auth
|
||||
result.tls_serverName = params.sni
|
||||
if params.insecure and (params.insecure == "1" or params.insecure == "0") then
|
||||
result.tls_allowInsecure = params.insecure
|
||||
@ -807,13 +809,17 @@ local function processData(szType, content, add_mode, add_from)
|
||||
|
||||
if has_hysteria2 then
|
||||
result.type = "Hysteria2"
|
||||
result.hysteria2_obfs = params["obfs-password"]
|
||||
if params["obfs-password"] then
|
||||
result.hysteria2_obfs = params["obfs-password"]
|
||||
end
|
||||
end
|
||||
if hysteria2_type_default == "sing-box" and has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = "hysteria2"
|
||||
result.hysteria2_obfs_type = "salamander"
|
||||
result.hysteria2_obfs_password = params["obfs-password"]
|
||||
if params["obfs-password"] then
|
||||
result.hysteria2_obfs_type = "salamander"
|
||||
result.hysteria2_obfs_password = params["obfs-password"]
|
||||
end
|
||||
end
|
||||
else
|
||||
log('暂时不支持' .. szType .. "类型的节点订阅,跳过此节点。")
|
||||
|
Loading…
Reference in New Issue
Block a user