mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-07-27 08:31:44 +08:00
update 2026-05-17 00:54:00
This commit is contained in:
parent
37f5311fe0
commit
ec98cc7413
@ -358,11 +358,13 @@ function is_special_node(e)
|
||||
end
|
||||
|
||||
function is_ip(val)
|
||||
val = trim(val):lower()
|
||||
local str = val:match("%[(.-)%]") or val
|
||||
return datatypes.ipaddr(str) or false
|
||||
end
|
||||
|
||||
function is_ipv6(val)
|
||||
val = trim(val):lower()
|
||||
local str = val:match("%[(.-)%]") or val
|
||||
return datatypes.ip6addr(str) or false
|
||||
end
|
||||
@ -470,9 +472,9 @@ function get_valid_nodes()
|
||||
end
|
||||
end
|
||||
local port = e.port or e.hysteria_hop or e.hysteria2_hop
|
||||
if port and e.address then
|
||||
if (port and e.address) or e.hysteria2_realms then
|
||||
local address = e.address
|
||||
if is_ip(address) or datatypes.hostname(address) then
|
||||
if is_ip(address) or datatypes.hostname(address) or e.hysteria2_realms then
|
||||
if (e.type == "sing-box" or e.type == "Xray") and e.protocol then
|
||||
local protocol = e.protocol
|
||||
if protocol == "vmess" then
|
||||
@ -501,8 +503,10 @@ function get_valid_nodes()
|
||||
if is_ipv6(address) then address = get_ipv6_full(address) end
|
||||
e["remark"] = trim("%s:[%s]" % {type_name, e.remarks})
|
||||
if show_node_info == "1" then
|
||||
port = port:gsub(":", "-")
|
||||
e["remark"] = trim("%s:[%s] %s:%s" % {type_name, e.remarks, address, port})
|
||||
port = (port or ""):gsub(":", "-")
|
||||
if not e.hysteria2_realms then
|
||||
e["remark"] = trim("%s:[%s] %s:%s" % {type_name, e.remarks, address, port})
|
||||
end
|
||||
end
|
||||
e.node_type = "normal"
|
||||
if not e.group or e.group == "" then
|
||||
|
||||
@ -61,15 +61,16 @@ function gen_config(var)
|
||||
local local_http_password = var["local_http_password"]
|
||||
local tcp_proxy_way = var["tcp_proxy_way"]
|
||||
local server_host = var["server_host"] or (node.address or ""):lower()
|
||||
local server_port = var["server_port"] or (node.port or "443")
|
||||
local server_port = var["server_port"] or node.port
|
||||
|
||||
if api.is_ipv6(server_host) then
|
||||
server_host = api.get_ipv6_full(server_host)
|
||||
end
|
||||
local server = server_host .. ":" .. server_port
|
||||
|
||||
if (node.hysteria2_hop) then
|
||||
server = server .. "," .. string.gsub(node.hysteria2_hop, ":", "-")
|
||||
local server = server_host .. (server_port and ":" .. server_port or "")
|
||||
|
||||
if node.hysteria2_hop then
|
||||
server = server .. (server_port and "," or ":") .. string.gsub(node.hysteria2_hop, ":", "-")
|
||||
end
|
||||
|
||||
local config = {
|
||||
|
||||
@ -374,6 +374,10 @@ run_socks() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${error_msg}" ] && [ "$(config_n_get $node hysteria2_realms)" = "1" ]; then
|
||||
unset error_msg
|
||||
fi
|
||||
|
||||
[ -n "${error_msg}" ] && {
|
||||
[ "$bind" != "127.0.0.1" ] && echolog " - Socks节点:[$remarks]${tmp},启动中止 ${bind}:${socks_port} ${error_msg}"
|
||||
return 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user