Compare commits

..

No commits in common. "2fdd6b8c39b873f490baf64f9e37db8906df6f90" and "6023dcae7c58314683a23860b1bd8ceace10515b" have entirely different histories.

View File

@ -47,7 +47,7 @@ find_netstat_path() {
probe_v2ray_listen() {
find_netstat_path || return
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}" || eval "echo \"${v2ray_listen}\" | grep -q '\[::\]:${proxy_port}'" ; then
if eval "echo \"${v2ray_listen}\" | grep -q :::${proxy_port}" || eval "echo \"${v2ray_listen}\" | grep -q 0.0.0.0:${proxy_port}" ; then
v2ray_share=true
return
elif eval "echo \"${v2ray_listen}\" | grep -q :${proxy_port}" ; then
@ -120,7 +120,7 @@ flush_nat_iptables() {
echo "[Info]: Clean nat proxy iptables rules."
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 OUTPUT -p tcp ! --dport 853 -j APP_TCP_PROXY 2>/dev/null
${iptables_wait} -t nat -D OUTPUT -p tcp -j APP_TCP_PROXY 2>/dev/null
if eval "echo \"${iptables_chains}\" | grep -q \":GUEST_TCP_PROXY \"" ; then
${iptables_wait} -t nat -F 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
fi
## apply proxy rules to iptables
${iptables_wait} -t nat -A OUTPUT -p tcp ! --dport 853 -j APP_TCP_PROXY
${iptables_wait} -t nat -A OUTPUT -p tcp -j APP_TCP_PROXY
}
proxy_guest_tcp_iptables() {