1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add V2Ray Socks Protocol support

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-08-25 15:39:34 +02:00
parent a8387400ba
commit 1e70503fe0
5 changed files with 76 additions and 33 deletions

View file

@ -675,7 +675,7 @@ function wizard_add()
ucic:set("shadowsocks-libev",sectionname,"disabled","0")
end
end)
elseif (default_proxy == "v2ray" or default_proxy == "v2ray-vmess" or default_proxy == "v2ray-trojan") and serversnb > 0 and serversnb > disablednb then
elseif (default_proxy == "v2ray" or default_proxy == "v2ray-vmess" or default_proxy == "v2ray-trojan" or default_proxy == "v2ray-socks") and serversnb > 0 and serversnb > disablednb then
--ucic:set("shadowsocks-libev","sss0","disabled","1")
ucic:set("v2ray","main","enabled","1")
if default_proxy == "v2ray" then
@ -684,6 +684,8 @@ function wizard_add()
ucic:set("v2ray","omrout","protocol","vmess")
elseif default_proxy == "v2ray-trojan" then
ucic:set("v2ray","omrout","protocol","trojan")
elseif default_proxy == "v2ray-socks" then
ucic:set("v2ray","omrout","protocol","socks")
end
ucic:foreach("shadowsocks-libev", "server", function(s)
local sectionname = s[".name"]
@ -741,6 +743,7 @@ function wizard_add()
ucic:set("v2ray","omrout","s_vmess_address",server_ip)
ucic:set("v2ray","omrout","s_vless_address",server_ip)
ucic:set("v2ray","omrout","s_trojan_address",server_ip)
ucic:set("v2ray","omrout","s_socks_address",server_ip)
luci.sys.call("uci -q del openvpn.omr.remote")
luci.sys.call("uci -q add_list openvpn.omr.remote=" .. server_ip)
ucic:set("qos","serverin","srchost",server_ip)
@ -780,6 +783,7 @@ function wizard_add()
ucic:set("v2ray","omrout","s_vmess_address",server_ip)
ucic:set("v2ray","omrout","s_vless_address",server_ip)
ucic:set("v2ray","omrout","s_trojan_address",server_ip)
ucic:set("v2ray","omrout","s_socks_address",server_ip)
luci.sys.call("uci -q del openvpn.omr.remote")
luci.sys.call("uci -q add_list openvpn.omr.remote=" .. server_ip)
ucic:set("qos","serverin","srchost",server_ip)
@ -832,6 +836,7 @@ function wizard_add()
ucic:set("v2ray","omrout","s_vmess_user_security","none")
ucic:set("v2ray","omrout","s_vless_user_security","none")
ucic:set("v2ray","omrout","s_trojan_user_security","none")
ucic:set("v2ray","omrout","s_socks_user_security","none")
elseif encryption == "aes-256-gcm" then
ucic:set("openmptcprouter","settings","encryption","aes-256-gcm")
ucic:set("shadowsocks-libev","sss0","method","aes-256-gcm")
@ -843,6 +848,7 @@ function wizard_add()
ucic:set("v2ray","omrout","s_vmess_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_vless_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_trojan_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_socks_user_security","aes-128-gcm")
elseif encryption == "aes-256-cfb" then
ucic:set("openmptcprouter","settings","encryption","aes-256-cfb")
ucic:set("shadowsocks-libev","sss0","method","aes-256-cfb")
@ -854,6 +860,7 @@ function wizard_add()
ucic:set("v2ray","omrout","s_vmess_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_vless_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_trojan_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_socks_user_security","aes-128-gcm")
elseif encryption == "chacha20-ietf-poly1305" then
ucic:set("openmptcprouter","settings","encryption","chacha20")
ucic:set("shadowsocks-libev","sss0","method","chacha20-ietf-poly1305")
@ -865,6 +872,7 @@ function wizard_add()
ucic:set("v2ray","omrout","s_vmess_user_security","chacha20-poly1305")
ucic:set("v2ray","omrout","s_vless_user_security","chacha20-poly1305")
ucic:set("v2ray","omrout","s_trojan_user_security","chacha20-poly1305")
ucic:set("v2ray","omrout","s_socks_user_security","chacha20-poly1305")
else
ucic:set("openmptcprouter","settings","encryption","other")
end
@ -906,6 +914,7 @@ function wizard_add()
ucic:set("v2ray","omrout","s_vmess_user_id",v2ray_user)
ucic:set("v2ray","omrout","s_vless_user_id",v2ray_user)
ucic:set("v2ray","omrout","s_trojan_user_id",v2ray_user)
ucic:set("v2ray","omrout","s_socks_user_id",v2ray_user)
ucic:save("v2ray")
ucic:commit("v2ray")

View file

@ -236,6 +236,7 @@
<% if nixio.fs.access("/etc/init.d/v2ray") then %><option value="v2ray" <% if uci:get("openmptcprouter","settings","proxy") == "v2ray" then %>selected="selected"<% end %>>V2Ray VLESS</option><% end %>
<% if nixio.fs.access("/etc/init.d/v2ray") then %><option value="v2ray-vmess" <% if uci:get("openmptcprouter","settings","proxy") == "v2ray-vmess" then %>selected="selected"<% end %>>V2Ray VMESS</option><% end %>
<% if nixio.fs.access("/etc/init.d/v2ray") then %><option value="v2ray-trojan" <% if uci:get("openmptcprouter","settings","proxy") == "v2ray-trojan" then %>selected="selected"<% end %>>V2Ray TROJAN</option><% end %>
<% if nixio.fs.access("/etc/init.d/v2ray") then %><option value="v2ray-socks" <% if uci:get("openmptcprouter","settings","proxy") == "v2ray-socks" then %>selected="selected"<% end %>>V2Ray SOCKS</option><% end %>
<option value="none" <% if uci:get("openmptcprouter","settings","proxy") == "none" then %>selected="selected"<% end %>>None</option>
</select>
<br />
@ -245,7 +246,7 @@
</div>
</div>
</div>
<% if nixio.fs.access("/etc/init.d/shadowsocks-libev") then %>
<div class="cbi-value">
<label class="cbi-value-title"><%:ShadowSocks key%></label>
<div class="cbi-value-field">
@ -256,6 +257,8 @@
</div>
</div>
</div>
<% end %>
<% if nixio.fs.access("/etc/init.d/v2ray") then %>
<div class="cbi-value">
<label class="cbi-value-title"><%:V2Ray user id%></label>
<div class="cbi-value-field">
@ -266,6 +269,7 @@
</div>
</div>
</div>
<% end %>
<div class="cbi-value">
<label class="cbi-value-title"><%:Encryption%></label>
<div class="cbi-value-field">