
Yes. With Python + httpx, route requests to .onion through Tor’s SOCKS5 proxy.
1) Install dependencies
pip install "httpx[socks]"
2) Use Tor SOCKS proxy (note socks5h)
socks5h means “proxy does hostname resolution” (needed for .onion).
import httpx
TOR_SOCKS = "socks5h://127.0.0.1:9050" # or 9150 (Tor Browser), or whatever you configured
url = "http://youronionaddresshere.onion/"
with httpx.Client(proxy=TOR_SOCKS, timeout=30.0) as client:
r = client.get(url)
print(r.status_code)
print(r.text[:500])
Yes. With Python + httpx, route requests to .onion through Tor’s SOCKS5 proxy.
1) Install dependencies
pip install "httpx[socks]"2) Use Tor SOCKS proxy (note socks5h)
socks5h means “proxy does hostname resolution” (needed for .onion).