diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 51aa986d6d..31e8031617 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -1076,6 +1076,14 @@ function wizard_add() luci.sys.call("/etc/init.d/shadowsocks-rust rules_down >/dev/null 2>/dev/null") end + -- Enable/disable v2ray/xray udp + local v2rayudp = luci.http.formvalue("v2rayudp") or "0" + ucic:set("v2ray","main_transparent_proxy","redirect_udp",v2rayudp) + ucic:save("v2ray") + ucic:commit("v2ray") + ucic:set("xray","main_transparent_proxy","redirect_udp",v2rayudp) + ucic:save("xray") + ucic:commit("xray") local v2ray_user = luci.http.formvalue("v2ray_user") ucic:set("v2ray","omrout","s_vmess_user_id",v2ray_user) @@ -1084,13 +1092,15 @@ function wizard_add() ucic:set("v2ray","omrout","s_socks_user_id",v2ray_user) ucic:save("v2ray") ucic:commit("v2ray") - ucic:set("xray","omrout","s_vmess_user_id",v2ray_user) - ucic:set("xray","omrout","s_vless_user_id",v2ray_user) - ucic:set("xray","omrout","s_vless_reality_user_id",v2ray_user) - ucic:set("xray","omrout","s_trojan_user_id",v2ray_user) - ucic:set("xray","omrout","s_socks_user_id",v2ray_user) + local xray_user = luci.http.formvalue("xray_user") + ucic:set("xray","omrout","s_vmess_user_id",xray_user) + ucic:set("xray","omrout","s_vless_user_id",xray_user) + ucic:set("xray","omrout","s_vless_reality_user_id",xray_user) + ucic:set("xray","omrout","s_trojan_user_id",xray_user) + ucic:set("xray","omrout","s_socks_user_id",xray_user) ucic:save("xray") ucic:commit("xray") + ucic:save("shadowsocks-libev") ucic:commit("shadowsocks-libev") ucic:save("shadowsocks-rust") diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 0d715c0276..1959140a29 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -321,18 +321,42 @@