In this Article
cURL is the universal way to test a proxy and to scrape from the command line or a shell script — and unlike headless browsers, it’s refreshingly simple: one flag and you’re routing through a proxy, with full support for credentials in the URL and even authenticated SOCKS5. This guide shows exactly how to use a proxy with cURL (HTTP, HTTPS, and SOCKS5, with authentication, env vars, a persistent config, and rotation), then ranks the 8 best proxies for cURL in 2026 by price and fit. DataImpulse at $1/GB is the value baseline.
I’m Andrii Byzov, an AI-Native Fractional CMO who lives in the terminal. Below: the copy-paste commands, the SOCKS5 DNS gotcha that causes leaks, and the providers worth your budget.
Key Facts
- One flag:
-x(or--proxy) routes a request through a proxy — e.g.curl -x http://host:port https://target. - cURL accepts credentials in the proxy URL (unlike Chrome):
-x http://user:pass@host:port, or use--proxy-user user:pass. - Authenticated SOCKS5 works in cURL — a key difference from browsers. Use
socks5h://(notsocks5://) so DNS resolves through the proxy and you don’t leak your real location. - Env vars and
.curlrclet you set a proxy globally (http_proxy,https_proxy,ALL_PROXY) so every request uses it without the flag. - DataImpulse is the value pick — residential $1/GB pay-as-you-go, datacenter $0.50/GB, mobile $2/GB, 90M+ IPs across 195 countries, HTTP/HTTPS/SOCKS5, country/city/ASN targeting.
How to Use a Proxy with cURL
1. Basic HTTP/HTTPS proxy with authentication
# credentials in the URL (__cr.us targets the US):
curl -x http://YOUR_LOGIN__cr.us:[email protected]:823 https://httpbin.org/ip
# or keep the URL clean and pass creds separately:
curl --proxy http://gw.dataimpulse.com:823 \
--proxy-user YOUR_LOGIN__cr.us:YOUR_PASSWORD \
https://httpbin.org/ip
https://httpbin.org/ip echoes the egress IP, so you can confirm the proxy is working. Add -v for verbose connection details.
2. SOCKS5 (with authentication — and avoid the DNS leak)
# socks5h:// resolves DNS through the proxy (no leak); socks5:// resolves locally
curl -x socks5h://YOUR_LOGIN__cr.us:[email protected]:824 https://httpbin.org/ip
Use socks5h (the trailing h) so hostnames resolve on the proxy side — with plain socks5 your machine does the DNS lookup and can reveal your real location. DataImpulse exposes SOCKS5 on port 824.
3. Environment variables & persistent config
# every request in this shell uses the proxy:
export https_proxy="http://YOUR_LOGIN__cr.us:[email protected]:823"
export http_proxy="$https_proxy"
curl https://httpbin.org/ip
# or make it permanent in ~/.curlrc:
echo 'proxy = "http://YOUR_LOGIN__cr.us:[email protected]:823"' >> ~/.curlrc
4. Rotating IPs
# a rotating gateway gives a fresh IP per request automatically:
for i in $(seq 1 5); do
curl -s -x http://YOUR_LOGIN__cr.us:[email protected]:823 https://httpbin.org/ip
done
With DataImpulse’s rotating residential gateway each request egresses from a new IP, so a simple loop spreads your scrape across the pool — no IP list to manage. For sticky sessions (same IP across requests) use the session parameter per the DataImpulse setup docs.
Best Proxies for cURL at a Glance
| Provider | Best for cURL | Residential price | Protocols | Notable |
|---|---|---|---|---|
| DataImpulse | Best value, scripts & testing | $1/GB PAYG | HTTP/HTTPS/SOCKS5 | 90M+ pool, auth SOCKS5, never-expires |
| Bright Data | Enterprise + managed | ~$4/GB promo; $8 regular | HTTP/HTTPS/SOCKS5 | Web Unlocker, SERP API, datasets |
| Oxylabs | Enterprise SLA | from $6/GB | HTTP/HTTPS/SOCKS5 | 175M+ pool, scraper APIs |
| Decodo | Mid-market, full geo grid | $3.75/GB (~$2 at 1TB+) | HTTP/HTTPS/SOCKS5 | 115M+ pool, sticky to 24h |
| IPRoyal | Long sticky sessions | from $7.35/GB | HTTP/HTTPS/SOCKS5 | Sticky up to 7 days; cheap PAYG |
| SOAX | Residential + mobile mix | $3.60/GB Starter | HTTP/HTTPS/SOCKS5 | 155M+ res, 33M+ mobile |
| Webshare | Budget / self-serve | from $3.50/mo res; $2.99/mo DC | HTTP/SOCKS5 | Free tier, cheapest datacenter |
| NetNut | ISP-residential stability | from $3.53/GB | HTTP/HTTPS | Consumer-ISP static IPs |

The picks, briefly
DataImpulse is the value baseline for cURL work — residential at $1/GB pay-as-you-go (datacenter $0.50/GB, mobile $2/GB), 90M+ IPs across 195 countries, HTTP/HTTPS and authenticated SOCKS5, with country/city/ASN targeting in the username. Traffic never expires, so test scripts don’t burn a subscription. Published success rate 99.51%; G2 4.8/5; 24/7 human support. For quick tests and high-volume shell scraping, it’s the lowest cost per successful request.
Bright Data is the enterprise pick (residential ~$8/GB regular, ~$4 promo) with Web Unlocker, SERP API, and datasets. Oxylabs (from $6/GB, 175M+ pool) is the SLA-grade option. Decodo (from $3.75/GB, sticky to 24h) is the balanced mid-market choice. IPRoyal (from $7.35/GB, sticky up to 7 days) suits long, session-stable scripts. SOAX ($3.60/GB, 155M+ residential + 33M+ mobile) adds a strong mobile pool. Webshare (free tier, datacenter from $2.99/mo) is the budget self-serve entry, and NetNut (from $3.53/GB) is the ISP-residential stability pick. All work with cURL’s -x flag out of the box.
Common cURL Proxy Mistakes
- Using
socks5://instead ofsocks5h://— plainsocks5resolves DNS locally and can leak your real location; usesocks5hfor proxy-side DNS. - Disabling TLS verification with
-kto “fix” errors — this hides man-in-the-middle risks; fix the real cause instead. - Confusing the proxy scheme with the target scheme. The scheme in
-x http://...is the proxy’s protocol (here HTTP); you can still fetch anhttps://URL through an HTTP proxy — cURL tunnels it viaCONNECT. - Leaving credentials in shell history. Prefer
~/.curlrc, a--configfile, or env vars over inline creds you don’t want logged. - Pointing datacenter IPs at defended targets — they get blocked fast; use residential for anti-bot-heavy sites.
Rotating vs Sticky with cURL
For broad scraping, a rotating residential gateway is ideal — each curl call gets a fresh IP, so a shell loop spreads requests across the pool with no IP management. For stateful sequences (a login then follow-up requests), use a sticky session so the same IP persists, and carry cookies with -c cookies.txt -b cookies.txt. Most cURL workflows are stateless scrapes, so rotating is the common default.
Which Proxy Type for cURL — Residential, Datacenter, or Mobile?
- Residential ($1/GB) — the default for defended targets (e-commerce, SERPs, social). If you pick one, pick this.
- Mobile ($2/GB) — real carrier IPs for the hardest targets and mobile-web surfaces.
- Datacenter ($0.50/GB) — cheapest and fastest for unprotected work, APIs, and your own infrastructure; don’t point it at anti-bot-heavy sites.
DataImpulse offers all three on one pay-as-you-go account, so a single script can route each request to the right tier via the username and endpoint.
How to Start with DataImpulse + cURL
Step 1. Create a DataImpulse account and grab residential credentials. The $5 / 5GB intro never expires — a real test budget.
Step 2. Run curl -x http://YOUR_LOGIN__cr.us:[email protected]:823 https://httpbin.org/ip to confirm the egress IP, then swap in your target URL. Use socks5h://...:824 for SOCKS5, and append a country code to the username for geo-targeting.
Step 3. Loop for rotation, add -c/-b for cookies on stateful flows, and store credentials in ~/.curlrc. See the DataImpulse tutorials and the residential proxies page.
FAQ
How do I use a proxy with cURL?
Add the -x (or --proxy) flag: curl -x http://user:pass@host:port https://target. cURL accepts credentials directly in the proxy URL, or you can pass them with --proxy-user user:pass. For DataImpulse: curl -x http://YOUR_LOGIN__cr.us:[email protected]:823 https://httpbin.org/ip.
Does cURL support authenticated SOCKS5 proxies?
Yes — unlike headless browsers (Chromium doesn’t support SOCKS5 auth), cURL handles authenticated SOCKS5 fine. Use curl -x socks5h://user:pass@host:port. Always use socks5h (with the h) so DNS resolves through the proxy; plain socks5 resolves locally and can leak your real location.
What’s the best proxy for cURL?
Residential proxies for defended targets — DataImpulse at $1/GB is the value pick (HTTP/HTTPS/SOCKS5, 90M+ IPs, authenticated SOCKS5). Bright Data and Oxylabs are the enterprise options; Webshare is cheapest to start. Any of them works with cURL’s -x flag; the choice comes down to price, pool quality, and whether you need managed APIs.
How do I set a proxy for all cURL requests?
Set environment variables — export https_proxy="http://user:pass@host:port" (and http_proxy, ALL_PROXY) — so every request in the shell uses the proxy, or add proxy = "http://user:pass@host:port" to ~/.curlrc to make it permanent. Use --noproxy to exclude specific hosts.
How do I rotate IPs with cURL?
Point cURL at a rotating residential gateway (e.g. DataImpulse) and each request egresses from a fresh IP automatically — a simple for loop over your URLs spreads the scrape across the pool with no IP list. For a stable IP across a sequence, use a sticky session instead and persist cookies with -c/-b.
Why is my cURL proxy returning errors?
Common causes: wrong scheme (use -x http:// for the proxy even when requesting an https:// URL), missing or misformatted credentials (try --proxy-user), using socks5 instead of socks5h, or a blocked datacenter IP on a defended site (switch to residential). Add -v to see the proxy handshake and pinpoint the failure.

State/City/Zip/ASN Targeting 



