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

V2Ray Trojan protocol can do UDP over TCP, disable UDP proxy using V2Ray by default

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-09-12 11:20:33 +02:00
parent e27ec3fe47
commit 59074daba9
4 changed files with 6 additions and 7 deletions

View file

@ -241,7 +241,7 @@
</select>
<br />
<div class="cbi-value-description">
<%:Set the default Proxy used for TCP when ShadowSocks is enabled, for TCP and UDP when V2Ray VLESS or VMESS is enabled.%>
<%:Set the default Proxy used for TCP when ShadowSocks is enabled, for TCP and UDP when V2Ray VLESS, VMESS or Trojan is enabled.%>
<%:Only ShadowSocks is supported with server multiple IPs for now.%>
</div>
</div>

View file

@ -448,7 +448,7 @@ add_v2ray_redirect_rules() {
v2ray-rules -f
#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" ] && ([ "$(uci -q get v2ray.omrout.protocol)" = "vless" ] || [ "$(uci -q get v2ray.omrout.protocol)" = "vmess" ]) && commandline="$commandline -L ${port}"
[ "$(uci -q get v2ray.main_transparent_proxy.redirect_udp)" = "1" ] && [ "$(uci -q get v2ray.omrout.protocol)" != "socks" ] && commandline="$commandline -L ${port}"
v2ray-rules $commandline
[ "$(uci -q get v2ray.main.inbounds | grep omr6)" != "" ] && [ -n "$OUTBOUND_SERVERS_V6" ] && {
v2ray-rules6 -f
@ -1885,7 +1885,7 @@ init_transparent_proxy() {
TRANSPARENT_PROXY_PORT="$redirect_port"
TRANSPARENT_PROXY_USE_TPROXY="$use_tproxy"
if [ "x$redirect_udp" = "x1" ] && [ "$(uci -q get v2ray.omrout.protocol)" != "trojan" ] && [ "$(uci -q get v2ray.omrout.protocol)" != "socks" ]; then
if [ "x$redirect_udp" = "x1" ] && [ "$(uci -q get v2ray.omrout.protocol)" != "socks" ]; then
TRANSPARENT_PROXY_ADDITION="udp"
elif [ "x$redirect_dns" = "x1" ] ; then
TRANSPARENT_PROXY_ADDITION="dns"

View file

@ -6,7 +6,7 @@ if [ -z "$(uci -q get v2ray.main)" ]; then
set v2ray.main=v2ray
set v2ray.main.v2ray_file='/usr/bin/v2ray'
set v2ray.main.mem_percentage='0'
set v2ray.main.loglevel='debug'
set v2ray.main.loglevel='error'
set v2ray.main.access_log='/dev/null'
set v2ray.main.error_log='/dev/null'
set v2ray.main.enabled='0'
@ -30,7 +30,7 @@ if [ -z "$(uci -q get v2ray.main)" ]; then
set v2ray.main_transparent_proxy.proxy_mode='default'
set v2ray.main_transparent_proxy.apnic_delegated_mirror='apnic'
set v2ray.main_transparent_proxy.gfwlist_mirror='github'
set v2ray.main_transparent_proxy.redirect_udp='1'
set v2ray.main_transparent_proxy.redirect_udp='0'
set v2ray.main_transparent_proxy.redirect_port='1897'
set v2ray.omrout=outbound
set v2ray.omrout.tag='omrout_tunnel'
@ -197,5 +197,4 @@ if [ "$(uci -q get v2ray.omrout.s_socks_port)" = "" ]; then
EOF
fi
fi
exit 0

View file

@ -2444,7 +2444,7 @@ index 729899015..41f70be7b 100644
+ if x != nil {
+ return x.Mptcp
+ }
+ return false
+ return true
+}
+
var File_transport_internet_config_proto protoreflect.FileDescriptor