Compare commits
2 Commits
6023dcae7c
...
2fdd6b8c39
Author | SHA1 | Date | |
---|---|---|---|
|
2fdd6b8c39 | ||
|
579ebdc018 |
@ -47,7 +47,7 @@ find_netstat_path() {
|
|||||||
probe_v2ray_listen() {
|
probe_v2ray_listen() {
|
||||||
find_netstat_path || return
|
find_netstat_path || return
|
||||||
v2ray_listen=`netstat -tnlp | grep v2ray | grep LISTEN`
|
v2ray_listen=`netstat -tnlp | grep v2ray | grep LISTEN`
|
||||||
if eval "echo \"${v2ray_listen}\" | grep -q :::${proxy_port}" || eval "echo \"${v2ray_listen}\" | grep -q 0.0.0.0:${proxy_port}" ; then
|
if eval "echo \"${v2ray_listen}\" | grep -q :::${proxy_port}" || eval "echo \"${v2ray_listen}\" | grep -q 0.0.0.0:${proxy_port}" || eval "echo \"${v2ray_listen}\" | grep -q '\[::\]:${proxy_port}'" ; then
|
||||||
v2ray_share=true
|
v2ray_share=true
|
||||||
return
|
return
|
||||||
elif eval "echo \"${v2ray_listen}\" | grep -q :${proxy_port}" ; then
|
elif eval "echo \"${v2ray_listen}\" | grep -q :${proxy_port}" ; then
|
||||||
@ -120,7 +120,7 @@ flush_nat_iptables() {
|
|||||||
echo "[Info]: Clean nat proxy iptables rules."
|
echo "[Info]: Clean nat proxy iptables rules."
|
||||||
iptables_chains=`iptables-save -t nat | cut -d ' ' -f 1 | tr "\n" " "`
|
iptables_chains=`iptables-save -t nat | cut -d ' ' -f 1 | tr "\n" " "`
|
||||||
${iptables_wait} -t nat -D PREROUTING -p tcp -j GUEST_TCP_PROXY 2>/dev/null
|
${iptables_wait} -t nat -D PREROUTING -p tcp -j GUEST_TCP_PROXY 2>/dev/null
|
||||||
${iptables_wait} -t nat -D OUTPUT -p tcp -j APP_TCP_PROXY 2>/dev/null
|
${iptables_wait} -t nat -D OUTPUT -p tcp ! --dport 853 -j APP_TCP_PROXY 2>/dev/null
|
||||||
if eval "echo \"${iptables_chains}\" | grep -q \":GUEST_TCP_PROXY \"" ; then
|
if eval "echo \"${iptables_chains}\" | grep -q \":GUEST_TCP_PROXY \"" ; then
|
||||||
${iptables_wait} -t nat -F GUEST_TCP_PROXY
|
${iptables_wait} -t nat -F GUEST_TCP_PROXY
|
||||||
${iptables_wait} -t nat -X GUEST_TCP_PROXY
|
${iptables_wait} -t nat -X GUEST_TCP_PROXY
|
||||||
@ -176,7 +176,7 @@ proxy_app_tcp_iptables() {
|
|||||||
${iptables_wait} -t nat -A APP_TCP_PROXY -m owner ! --uid-owner ${inet_uid} -j V2RAY
|
${iptables_wait} -t nat -A APP_TCP_PROXY -m owner ! --uid-owner ${inet_uid} -j V2RAY
|
||||||
fi
|
fi
|
||||||
## apply proxy rules to iptables
|
## apply proxy rules to iptables
|
||||||
${iptables_wait} -t nat -A OUTPUT -p tcp -j APP_TCP_PROXY
|
${iptables_wait} -t nat -A OUTPUT -p tcp ! --dport 853 -j APP_TCP_PROXY
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_guest_tcp_iptables() {
|
proxy_guest_tcp_iptables() {
|
||||||
|
Loading…
Reference in New Issue
Block a user