Skip to content

Instantly share code, notes, and snippets.

@restyler
Last active February 16, 2024 21:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save restyler/69ceb2284be4ed54c340b3123fb71df4 to your computer and use it in GitHub Desktop.
Save restyler/69ceb2284be4ed54c340b3123fb71df4 to your computer and use it in GitHub Desktop.
CURL one-line proxy checker (shows connection speed, ip, and geo of proxy)
#!/bin/bash
# download, do chmod +x and copy to /usr/bin/local via ln -s /downloaded-dir/pcheck.sh /usr/local/bin/pcheck
# then launch as: pcheck http://user:pw@proxy-addr:port (to view ip and geo via lumtest.com website)
# or pcheck http://user:pw@proxy-addr:port https://www.google.com/ (to download specific website)
curl -w @- -sS -H "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" --proxy "$1" ${2:-"https://lumtest.com/myip.json"} <<'EOF'
\n
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
EOF
@restyler
Copy link
Author

restyler commented Apr 10, 2022

pcheck is a simple bash script which saves you a lot of typing if you work with proxies. it helps to quickly check if particular proxy is alive and working fine, and shows proxy geo, as well. Examples:

Check if proxy is alive and view its geo:

pcheck http://user:pw@proxy-addr:port

Download file/arbitrary website page for a better speed testing:

pcheck http://user:pw@proxy-addr:port https://example.com/download.zip

more info: https://pixeljets.com/blog/simple-proxy-checker-in-curl-bash/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment