This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setproxy() { | |
local proxy="http://127.0.0.1:20171" | |
for v in http_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY; do | |
export $v="$proxy" | |
done | |
echo "Proxy set to $proxy" | |
# auto check proxy | |
if curl -s --connect-timeout 5 -I https://www.google.com --proxy $proxy | grep "200" >/dev/null; then | |
echo "✅ Proxy is working (Google reachable)" |