mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 10:31:51 +00:00
Add option to disable UDP transport via V2Ray
This commit is contained in:
parent
4f53ff1fba
commit
643dd1e00d
3 changed files with 17 additions and 2 deletions
|
@ -1153,6 +1153,10 @@ function settings_add()
|
|||
local shadowsocksudp = luci.http.formvalue("shadowsocksudp") or "0"
|
||||
ucic:set("openmptcprouter","settings","shadowsocksudp",shadowsocksudp)
|
||||
|
||||
-- Enable/disable v2ray udp
|
||||
local shadowsocksudp = luci.http.formvalue("v2rayudp") or "1"
|
||||
ucic:set("v2ray","main_transparent_proxy","redirect_udp",v2rayudp)
|
||||
|
||||
-- Enable/disable nDPI
|
||||
local ndpi = luci.http.formvalue("ndpi") or "1"
|
||||
ucic:set("openmptcprouter","settings","ndpi",ndpi)
|
||||
|
|
|
@ -297,6 +297,12 @@
|
|||
<input type="checkbox" name="shadowsocksudp" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter","settings","shadowsocksudp") == "1" then %>checked<% end %>>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:When proxy V2Ray is used, use it for UDP%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="checkbox" name="v2rayudp" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("v2ray","main_transparent_proxy","redirect_udp") == "1" then %>checked<% end %>>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Disable default gateway%></label>
|
||||
<div class="cbi-value-field">
|
||||
|
|
|
@ -414,10 +414,15 @@ add_v2ray_redirect_rules() {
|
|||
|
||||
# This part need a rewrite
|
||||
v2ray-rules -f
|
||||
v2ray-rules -l ${port} -L ${port} -s $OUTBOUND_SERVERS_V4 --rule-name def --src-default forward --dst-default forward --local-default forward
|
||||
logger -t "v2ray" "v2ray-rules -l ${port} -L ${port} -s $OUTBOUND_SERVERS_V4 --rule-name def --src-default forward --dst-default forward --local-default forward"
|
||||
commandline="-l ${port} -s $OUTBOUND_SERVERS_V4 --rule-name def --src-default forward --dst-default forward --local-default forward"
|
||||
[ "$(uci -q get v2ray.main_transparent_proxy.redirect_udp)" = "1" ] && commandline="$commandline -L ${port}"
|
||||
v2ray-rules $commandline
|
||||
[ "$(uci -q get v2ray.main.inbounds | grep omr6)" != "" ] && {
|
||||
v2ray-rules6 -f
|
||||
v2ray-rules6 -l $((port+1)) -L $((port+1)) -s $OUTBOUND_SERVERS_V6 --rule-name def --src-default forward --dst-default forward --local-default forward
|
||||
commandline="-l $((port+1)) -L $((port+1)) -s $OUTBOUND_SERVERS_V6 --rule-name def --src-default forward --dst-default forward --local-default forward"
|
||||
[ "$(uci -q get v2ray.main_transparent_proxy.redirect_udp)" = "1" ] && commandline="$commandline -L ${port+1}"
|
||||
v2ray-rules6 $commandline
|
||||
}
|
||||
[ -f /etc/init.d/omr-bypass ] && {
|
||||
logger -t "v2ray" "Reload omr-bypass rules"
|
||||
|
|
Loading…
Reference in a new issue