mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-06-16 02:25:29 +08:00
luci-app-v2ray-server: add http proxy support and fix bug (#2601)
* luci-app-v2ray-server: add http proxy support and fix socks config saving when user or password empty error * luci-app-v2ray-server: add missing msgid
This commit is contained in:
parent
4ae1049cff
commit
d11dfd403d
@ -15,13 +15,23 @@ if server.protocol == "vmess" then
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif server.protocol == "http" then
|
||||||
|
proset = {
|
||||||
|
allowTransparent = false,
|
||||||
|
accounts = {
|
||||||
|
{
|
||||||
|
user = (server.Http_user == nil) and "lean" or server.Http_user,
|
||||||
|
pass = (server.Http_pass == nil) and "password" or server.Http_pass
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
proset = {
|
proset = {
|
||||||
auth = "password",
|
auth = "password",
|
||||||
accounts = {
|
accounts = {
|
||||||
{
|
{
|
||||||
user = server.Socks_user,
|
user = (server.Socks_user == nil) and "lean" or server.Socks_user,
|
||||||
pass = server.Socks_pass
|
pass = (server.Socks_pass == nil) and "password" or server.Socks_pass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -33,12 +43,12 @@ local v2ray = {
|
|||||||
--error = "/var/log/v2ray.log",
|
--error = "/var/log/v2ray.log",
|
||||||
loglevel = "warning"
|
loglevel = "warning"
|
||||||
},
|
},
|
||||||
-- 传入连接
|
-- 传入连接
|
||||||
inbound = {
|
inbound = {
|
||||||
port = tonumber(server.port),
|
port = tonumber(server.port),
|
||||||
protocol = server.protocol,
|
protocol = server.protocol,
|
||||||
settings = proset,
|
settings = proset,
|
||||||
-- 底层传输配置
|
-- 底层传输配置
|
||||||
streamSettings = {
|
streamSettings = {
|
||||||
network = server.transport,
|
network = server.transport,
|
||||||
security = (server.tls == '1') and "tls" or "none",
|
security = (server.tls == '1') and "tls" or "none",
|
||||||
@ -67,11 +77,11 @@ local v2ray = {
|
|||||||
} or nil
|
} or nil
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
-- 传出连接
|
-- 传出连接
|
||||||
outbound = {
|
outbound = {
|
||||||
protocol = "freedom"
|
protocol = "freedom"
|
||||||
},
|
},
|
||||||
-- 额外传出连接
|
-- 额外传出连接
|
||||||
outboundDetour = {
|
outboundDetour = {
|
||||||
{
|
{
|
||||||
protocol = "blackhole",
|
protocol = "blackhole",
|
||||||
|
@ -32,6 +32,7 @@ e.default=10086
|
|||||||
e=t:option(ListValue,"protocol",translate("Protocol"))
|
e=t:option(ListValue,"protocol",translate("Protocol"))
|
||||||
e:value("vmess",translate("Vmess"))
|
e:value("vmess",translate("Vmess"))
|
||||||
e:value("socks",translate("Socks"))
|
e:value("socks",translate("Socks"))
|
||||||
|
e:value("http",translate("Http"))
|
||||||
|
|
||||||
e=t:option(Value,"VMess_id",translate("ID"))
|
e=t:option(Value,"VMess_id",translate("ID"))
|
||||||
e.default=luci.sys.exec("cat /proc/sys/kernel/random/uuid")
|
e.default=luci.sys.exec("cat /proc/sys/kernel/random/uuid")
|
||||||
@ -54,6 +55,17 @@ e.rmempty=true
|
|||||||
e.password=true
|
e.password=true
|
||||||
e:depends("protocol","socks")
|
e:depends("protocol","socks")
|
||||||
|
|
||||||
|
e=t:option(Value,"Http_user",translate("User name"))
|
||||||
|
e.default="lean"
|
||||||
|
e.rmempty=true
|
||||||
|
e:depends("protocol","http")
|
||||||
|
|
||||||
|
e=t:option(Value,"Http_pass",translate("Password"))
|
||||||
|
e.default="password"
|
||||||
|
e.rmempty=true
|
||||||
|
e.password=true
|
||||||
|
e:depends("protocol","http")
|
||||||
|
|
||||||
e=t:option(Value,"VMess_level",translate("User Level"))
|
e=t:option(Value,"VMess_level",translate("User Level"))
|
||||||
e.default=1
|
e.default=1
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@ msgstr "备注"
|
|||||||
msgid "Port"
|
msgid "Port"
|
||||||
msgstr "端口"
|
msgstr "端口"
|
||||||
|
|
||||||
|
msgid "User name"
|
||||||
|
msgstr "用户名"
|
||||||
|
|
||||||
msgid "Password"
|
msgid "Password"
|
||||||
msgstr "密码"
|
msgstr "密码"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user