mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
v2ray plugin support
This commit is contained in:
parent
df7a7ffd2b
commit
58b4ff3198
8 changed files with 186 additions and 40 deletions
|
@ -8,7 +8,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Support for shadowsocks-libev
|
||||
LUCI_DEPENDS:=+shadowsocks-libev-config +shadowsocks-libev-ss-local +shadowsocks-libev-ss-redir +shadowsocks-libev-ss-rules +shadowsocks-libev-ss-server +shadowsocks-libev-ss-tunnel +simple-obfs
|
||||
LUCI_DEPENDS:=+shadowsocks-libev-config +shadowsocks-libev-ss-local +shadowsocks-libev-ss-redir +shadowsocks-libev-ss-rules +shadowsocks-libev-ss-server +shadowsocks-libev-ss-tunnel +simple-obfs +v2ray-plugin
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@ s:taboption("general", Flag, "disabled", translate("Disable"))
|
|||
ss.option_install_package(s, "general")
|
||||
ss.options_common(s, "advanced")
|
||||
local obfs_installed = nixio.fs.access("/usr/bin/obfs-local")
|
||||
if obfs_installed then
|
||||
local v2ray_installed = nixio.fs.access("/usr/bin/v2ray-plugin")
|
||||
if obfs_installed or v2ray_installed then
|
||||
ss.options_obfs(s, "obfuscate")
|
||||
end
|
||||
|
||||
|
@ -47,9 +48,11 @@ else
|
|||
translate("The address ss-tunnel will forward traffic to"))
|
||||
o.datatype = "hostport"
|
||||
end
|
||||
if obfs_installed then
|
||||
if obfs_installed or v2ray_installed then
|
||||
o = s:taboption("obfuscate", Value, "obfs_host", translate("Host"))
|
||||
o.default = "www.bing.com"
|
||||
end
|
||||
if obfs_installed then
|
||||
s:taboption("obfuscate", Value, "obfs_uri", translate("HTTP path uri"))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -131,10 +131,22 @@ end
|
|||
|
||||
function options_obfs(s, tab)
|
||||
local o
|
||||
local v2ray_installed = nixio.fs.access("/usr/bin/v2ray-plugin")
|
||||
local obfs_installed = nixio.fs.access("/usr/bin/obfs-local")
|
||||
s:taboption(tab, Flag, "obfs", translate("Enable"))
|
||||
o = s:taboption(tab, ListValue, "obfs_plugin", translate("Plugin"))
|
||||
if v2ray_installed then
|
||||
o:value("v2ray")
|
||||
o.default = "v2ray"
|
||||
else
|
||||
o.default = "obfs-simple"
|
||||
end
|
||||
if obfs_installed then
|
||||
o:value("obfs-simple")
|
||||
end
|
||||
o = s:taboption(tab, ListValue, "obfs_type", translate("Type"))
|
||||
o:value("http")
|
||||
o:value("tls")
|
||||
--o:value("tls")
|
||||
o.default = "http"
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue