How to Check Your Proxy IP and Connectivity
Check that a proxy works and which IP websites see: curl one-liners, a Python checker with latency, and common errors with their causes.
· 2 min read
Before you plug a proxy into a scraper or an app, check two things: that it accepts your credentials and which IP address the target sees.
One-line check with curl
curl -x socks5h://LOGIN:PASSWORD@HOST:PORT https://api.ipify.org
curl -x http://LOGIN:PASSWORD@HOST:PORT https://api.ipify.org
The output is the exit IP. Compare it with your own IP (curl https://api.ipify.org without -x) — they must differ.
Add -v to see the proxy handshake and -w "%{time_total}\n" to measure the total time.
Python checker with latency
import time
import requests # pip install "requests[socks]"
def check_proxy(proxy_url: str, timeout: float = 15) -> dict:
proxies = {"http": proxy_url, "https": proxy_url}
started = time.perf_counter()
try:
r = requests.get("https://api.ipify.org?format=json", proxies=proxies, timeout=timeout)
r.raise_for_status()
except requests.exceptions.RequestException as exc:
return {"ok": False, "error": type(exc).__name__}
return {"ok": True, "ip": r.json()["ip"], "latency_ms": round((time.perf_counter() - started) * 1000)}
print(check_proxy("socks5h://LOGIN:PASSWORD@HOST:PORT"))
The result looks like {'ok': True, 'ip': '203.0.113.7', 'latency_ms': 699}; the latency includes the TLS handshake with the target.
Common errors
| Symptom | Likely cause |
|---|---|
curl: (97) / ConnectionError right away |
Wrong login or password: the proxy rejected authentication |
407 Proxy Authentication Required |
HTTP proxy without credentials or with wrong ones |
| Connection timed out | Wrong host or port, a firewall, or the proxy is down |
InvalidSchema: Missing dependencies for SOCKS support |
Install requests[socks] |
| Works in curl, not in code | Only http is set in proxies — add https too |
After an IP change on a mobile proxy
On mobile 4G/5G proxies the IP changes after you press “Change IP”. Wait a few seconds for the modem to reconnect and run the check again — the new IP also appears in “My proxies”.
Learn more about mobile proxies or the difference between SOCKS5 and HTTP.