Created
May 17, 2025 14:45
-
-
Save masterdesky/08bd89888ac070d131aa7765291e84ee to your computer and use it in GitHub Desktop.
Route wget traffic through Tor using torsocks
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
#!/usr/bin/env bash | |
# Route wget traffic through Tor using torsocks | |
# Usage: ./torwget.sh [wget-options] URL | |
if [ $# -ge 1 ]; then | |
>&2 echo "Usage: $0 [wget-options] URL" | |
exit 1 | |
fi | |
if ! command -v torsocks &> /dev/null; then | |
>&2 echo "torsocks is not installed. Please install it first." | |
exit 1 | |
fi | |
# Unset http(s) proxy envvars to avoid leaks | |
unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY | |
exec torsocks /usr/bin/wget --passive-ftp "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment