luci: add Mixed support to sing-box server
mixed inbound is a socks4, socks4a, socks5 and http server.
This commit is contained in:
parent
4262fe4238
commit
0163ec8578
@ -48,6 +48,7 @@ local ss_method_list = {
|
||||
s.fields["type"]:value(type_name, "Sing-Box")
|
||||
|
||||
o = s:option(ListValue, option_name("protocol"), translate("Protocol"))
|
||||
o:value("mixed", "Mixed")
|
||||
o:value("socks", "Socks")
|
||||
o:value("http", "HTTP")
|
||||
o:value("shadowsocks", "Shadowsocks")
|
||||
@ -70,6 +71,7 @@ o.validate = function(self, value, t)
|
||||
end
|
||||
return value
|
||||
end
|
||||
o:depends({ [option_name("protocol")] = "mixed" })
|
||||
o:depends({ [option_name("protocol")] = "socks" })
|
||||
o:depends({ [option_name("protocol")] = "http" })
|
||||
|
||||
|
@ -386,6 +386,18 @@ function gen_config_server(node)
|
||||
|
||||
local protocol_table = nil
|
||||
|
||||
if node.protocol == "mixed" then
|
||||
protocol_table = {
|
||||
users = (node.auth == "1") and {
|
||||
{
|
||||
username = node.username,
|
||||
password = node.password
|
||||
}
|
||||
} or nil,
|
||||
set_system_proxy = false
|
||||
}
|
||||
end
|
||||
|
||||
if node.protocol == "socks" then
|
||||
protocol_table = {
|
||||
users = (node.auth == "1") and {
|
||||
|
Loading…
Reference in New Issue
Block a user