mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 21:15:13 +08:00
🏅 Sync 2026-08-09 09:19:32
This commit is contained in:
1 parent
ee62266d6b
commit
40a4a808cd
32 files changed
+313
-221
No files matched your search
@@ -981,37 +981,26 @@ function gen_config(var)
|
||||
end
|
||||
|
||||
|
||||
function gen_socks_config_node(node_id, socks_id, remarks)
|
||||
if node_id then
|
||||
socks_id = node_id:sub(1 + #"Socks_")
|
||||
end
|
||||
local result
|
||||
local socks_node = uci:get_all(appname, socks_id) or nil
|
||||
if socks_node then
|
||||
if not remarks then
|
||||
remarks = socks_node.port
|
||||
end
|
||||
result = {
|
||||
[".name"] = "Socksid_" .. socks_id,
|
||||
remarks = remarks,
|
||||
function get_node_by_id(node_id)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
local section = uci:get_all(appname, node_id) or {}
|
||||
if section[".type"] == "socks" then
|
||||
local result = {
|
||||
[".name"] = node_id,
|
||||
remarks = "socks[%s]" % section.port,
|
||||
type = "Xray",
|
||||
protocol = "socks",
|
||||
address = "127.0.0.1",
|
||||
port = socks_node.port,
|
||||
port = section.port,
|
||||
transport = "tcp",
|
||||
stream_security = "none"
|
||||
}
|
||||
return result
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
function get_node_by_id(node_id)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
if node_id:find("Socks_") then
|
||||
return gen_socks_config_node(node_id)
|
||||
else
|
||||
return uci:get_all(appname, node_id)
|
||||
if section[".type"] == "nodes" then
|
||||
return section
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function gen_loopback(outbound_tag, loopback_dst)
|
||||
|
||||
Reference in new issue
Block a user