
1. Download the list
curl -sL https://raw.githubusercontent.com/xyzs996/free-proxy-health-list/main/all.txt -o proxies.txt2. Load and rotate
import itertools, requests
proxies = [line.strip() for line in open("proxies.txt") if line.strip()]
pool = itertools.cycle(proxies)
def fetch(url):
for _ in range(10):
proxy = next(pool)
try:
return requests.get(
url,
proxies={"http": f"http://{proxy}", "https": f"http://{proxy}"},
timeout=8,
)
except requests.RequestException:
continue
raise RuntimeError("no working proxy")Notes that save time
Free proxies fail often by nature, so the loop above is the important part: always try the next entry rather than treating one failure as fatal. Keep the timeout short — a dead proxy costs you the full timeout on every request — and re-download the list on the publish cadence so you are not cycling through entries that expired hours ago. Respect robots.txt and the target site's terms; rotation is for spreading load, not for evading access controls.
Related guides
Public snapshot boundary
Free public proxies are shared and operated by unknown parties. Never send passwords, tokens or personal data through them. Follow the GitHub Acceptable Use Policies: no spam, no attacks, no bypassing access controls, no scraping against site policies.
Free public proxies are shared and operated by unknown parties. Never send passwords, tokens or personal data through them. Follow the GitHub Acceptable Use Policies: no spam, no attacks, no bypassing access controls, no scraping against site policies.