How to use a proxy with cURL (command-line syntax & debugging)
Updated:
The curl command-line utility is the fastest way to verify proxy authentication, inspect HTTP response headers, and benchmark round-trip latency from Linux, macOS, or Windows terminals using your VinaProxy ip:port:user:pass credentials.
curl -x http://user:pass@ip:port https://vinaproxy.com/api/my-ip- 1 IP₫40,000
- 5+ IPs₫35,000
- 10+ IPs₫25,000
- 20+ IPs₫25,000
- 50+ IPs₫25,000
- 100+ IPs₫25,000
- 200+ IPs₫25,000
- 500+ IPs₫25,000
- 1000+ IPs₫22,000
- 2000+ IPs₫20,000
- 1 IP₫40,000
- 5+ IPs₫35,000
- 10+ IPs₫25,000
- 20+ IPs₫25,000
- 50+ IPs₫25,000
- 100+ IPs₫25,000
- 200+ IPs₫25,000
- 500+ IPs₫25,000
- 1000+ IPs₫22,000
- 2000+ IPs₫20,000
Essential cURL proxy flags & one-liners
Pass your proxy via -x (--proxy) and -U (--proxy-user), or combine them into a single http://user:pass@ip:port URL:
| Task | cURL Command | What It Shows |
|---|---|---|
| Check exit IP | curl -x http://user:pass@ip:port https://vinaproxy.com/api/my-ip | Returns JSON with the proxy's public IPv4 |
| Separate credentials | curl -x http://ip:port -U "user:pass" https://vinaproxy.com/api/my-ip | Safest when passwords contain special characters |
| Inspect headers only | curl -I -x http://user:pass@ip:port https://example.com | Fetches HTTP status code and response headers |
| Measure TTFB latency | curl -s -o /dev/null -w "Connect:%{time_connect}s TTFB:%{time_starttransfer}s\n" -x http://user:pass@ip:port https://example.com | Measures TCP handshake and first-byte timing |
Pro tips for Windows PowerShell & shell scripts
- In Windows PowerShell,
curlis aliased toInvoke-WebRequestby default—always invokecurl.exe -x ...to use the real cURL binary - Add
-v(verbose) to inspect theCONNECThandshake and confirmHTTP/1.1 200 Connection established - Include
--connect-timeout 5 --max-time 15in cronjobs and shell scripts so slow targets never hang your pipeline - Store
proxy = "http://user:pass@ip:port"in~/.curlrcif you want a default proxy for allcurlinvocations
Step by step
- 1
Open your terminal (or cmd / PowerShell on Windows)
Remember to type
curl.exeif you are inside Windows PowerShell. - 2
Run a test request through your proxy
Execute
curl.exe -x http://user:pass@ip:port https://vinaproxy.com/api/my-ipusing your VinaProxy credentials. - 3
Debug handshake headers with -v if needed
Append
-vto inspect theProxy-Authorizationheader and TLS handshake. - 4
Add timeout guards in production scripts
Pass
--connect-timeout 5 --max-time 15in automated shell scripts.
Frequently asked questions
Why does `curl -x` fail with a parameter error in Windows PowerShell?
PowerShell aliases curl to Invoke-WebRequest. Run curl.exe -x http://user:pass@ip:port ... with the .exe extension to invoke native cURL.
What does `HTTP/1.1 407 Proxy Authentication Required` mean in `curl -v`?
It means cURL reached the proxy server IP and port, but the username or password passed to -x or -U was incorrect.
Can I test multiple proxies without running cURL in a loop?
Yes—paste up to 100 proxies into our web-based Proxy Checker or Proxy Speed Test.
Get low-latency HTTP(S) proxies for cURL & CLI tools
Instant Dedicated IPv4 and Static ISP credentials across 7 countries.
Buy cURL Proxies