curl
Using our proxies with curl
curl is the quickest way to confirm that a proxy works before you wire it into code. One command shows the exit IP; the same flags then go into your scripts and health checks.
Pick a proxyCompatibility
- -x / --proxy accepts http://, https://, socks4://, socks4a://, socks5:// and socks5h:// prefixes; a proxy without a prefix is treated as an HTTP proxy.
- -U / --proxy-user sets the proxy username and password; credentials can also be written in the proxy URL and are URL-decoded by curl.
- socks5:// resolves the target hostname locally, socks5h:// lets the proxy resolve it.
- If no port is given, curl assumes 1080 (443 for https:// proxies), so always pass the port we send you.
- Protocols:
- HTTP, HTTPS (CONNECT), SOCKS5
- Connection:
- Username and password, IP allowlist
Configuration
# HTTP proxy (HTTPS targets are tunnelled with CONNECT)
curl -x "http://PROXY_HOST:PORT" -U "USERNAME:PASSWORD" "https://api.ipify.org?format=json"
# SOCKS5 proxy, hostname resolved by the proxy (socks5h)
curl -x "socks5h://PROXY_HOST:PORT" -U "USERNAME:PASSWORD" "https://api.ipify.org?format=json"
# IP allowlist: omit -U
curl -x "http://PROXY_HOST:PORT" "https://api.ipify.org?format=json"The first command uses an HTTP proxy; https:// targets go through it as a CONNECT tunnel. The second uses SOCKS5 with DNS resolved on the proxy side. With IP allowlist access, drop -U.
PROXY_HOST, PORT, USERNAME and PASSWORD are placeholders. After we select proxies for your task, we send you the real host, port and credentials.
Check the result
curl -sS -x "http://PROXY_HOST:PORT" -U "USERNAME:PASSWORD" "https://api.ipify.org?format=json"
# expected output: {"ip":"<exit IP>"}- Run the test command: the JSON response must contain the exit IP we sent you, not your own address.
- Look up the exit IP in two independent GeoIP services and confirm both show the country (and city, if you asked for one) from your request. GeoIP databases can disagree; tell us if they do.
- Request a page of your own site (or another page you are permitted to check) through the same proxy and confirm the status code and content are what you expect for that country.
What to put in the request
- Protocol you plan to use: HTTP or SOCKS5 (socks5h if DNS must be resolved by the proxy).
- Access method: username/password, or the static IP of the machine running curl for an allowlist.
- Country, and city if your check depends on it.
- Session mode: static IP, sticky session or rotation per request.
- What you are checking (your own site, monitoring, a permitted public source).
Common pitfalls
- Passwords with characters like @, : or # break the URL form; use -U or URL-encode them.
- Using socks5:// when you need the proxy's view of DNS: the hostname is then resolved on your machine. Use socks5h:// instead.
- Leaving credentials on the command line: the curl manual warns they can be briefly visible to other users of the system. Prefer a config file or environment variable in shared environments.
Recommended proxy types
Residential proxiesIP addresses of home internet connections, assigned by consumer ISPs.Mobile proxiesIP addresses of mobile carriers, shared by many phones behind carrier NAT.Static ISP proxiesFixed IP addresses registered to internet providers and hosted in data centers.Datacenter proxiesServer IP addresses from hosting networks — fast, stable and inexpensive.Use caseLocal QA and localization testingUse caseGeolocation testingUse caseSite availability and page monitoring
Sources
Not sure which proxy fits?
Describe the task in two sentences. We reply with a concrete setup and price, usually within one business day.
Availability, exact parameters and price are confirmed in our reply after manual selection. Nothing is charged automatically.