Using cURL with an authenticated proxy: commands that prove it works

Updated:

To run cURL through a proxy, give it the proxy address with -x and your login with -U, or put both in one http://user:pass@ip:port URL. Before you wire a ProxyV4 IP into a scraper, a browser profile or a cron job, one cURL call from the same machine tells you three things fast: the credentials are accepted, the exit IP is the one you rented, and the round trip is reasonable.

cURL · HTTP Proxy Format
curl -x http://user:pass@ip:port https://proxyv4.com/api/my-ip
Proxies by platform:web-scrapingseo-rank-tracking

From the dashboard line to a cURL argument

Your order arrives as ip:port:user:pass. cURL does not read that layout directly, so split it: the first two fields go into -x http://ip:port, the last two into -U user:pass. The single-URL form http://user:pass@ip:port is shorter, but any @, : or # inside the password then has to be percent-encoded, which is why the split form is the safer default in scripts.

Keep the http:// scheme on the proxy even when the target is https://. cURL talks plain HTTP to the proxy, asks it to open a tunnel with CONNECT, and then runs TLS to the website through that tunnel, so the page itself stays encrypted end to end.

Command reference

GoalCommandRead the result
See which IP the internet seescurl -x http://user:pass@ip:port https://proxyv4.com/api/my-ipThe address printed should equal the proxy IP, not your own
Pass the login separatelycurl -x http://ip:port -U "user:pass" https://proxyv4.com/api/my-ipSame output; no URL encoding needed for odd password characters
Status line and headers onlycurl -I -x http://user:pass@ip:port https://example.comA 2xx or 3xx line means the target answered through the proxy
Connect time and time to first bytecurl -s -o /dev/null -w "Connect:%{time_connect}s TTFB:%{time_starttransfer}s\n" -x http://user:pass@ip:port https://example.comTwo numbers in seconds; compare them across proxies or locations

Debugging a failed request with -v

Add -v and read the lines that start with > and <. A healthy run shows cURL sending CONNECT with a Proxy-Authorization header and the proxy replying HTTP/1.1 200 Connection established, followed by the TLS handshake with the target.

If the reply is HTTP/1.1 407 Proxy Authentication Required, the connection to the proxy worked and only the username or password is wrong; the 407 error guide walks through the usual causes. If cURL never gets a reply at all, the problem is reachability, so check the IP and port first with the port checker.

Windows, scripts and defaults

  • Windows PowerShell maps curl to Invoke-WebRequest, which does not understand -x; type curl.exe to reach the real binary
  • On Windows, swap -o /dev/null for -o NUL in the timing command
  • In cron jobs and shell scripts add --connect-timeout 5 --max-time 15 so one slow target cannot stall the whole run
  • To route every cURL call through the same proxy, put proxy = "http://user:pass@ip:port" in ~/.curlrc and remove it when you are done testing

Step by step

  1. 1

    Open a shell

    Use Terminal on macOS or Linux, or cmd / PowerShell on Windows (where the command is curl.exe).

  2. 2

    Request your exit IP through the proxy

    Run curl.exe -x http://user:pass@ip:port https://proxyv4.com/api/my-ip with the values from your ProxyV4 order and check that the printed address is the proxy IP.

  3. 3

    Look at the handshake if it fails

    Repeat the call with -v and find the proxy's reply to CONNECT: 200 means the tunnel opened, 407 means the login was refused.

  4. 4

    Harden the command for automation

    Before the line goes into a script, add --connect-timeout 5 --max-time 15.

Frequently asked questions

Why does PowerShell reject `curl -x` with a parameter error?

In PowerShell, curl is an alias for Invoke-WebRequest, which has no -x option. Call curl.exe -x http://user:pass@ip:port ... and Windows runs the native cURL instead.

cURL shows `407 Proxy Authentication Required`. Is the proxy down?

No. A 407 is an answer from the proxy, so the IP and port are reachable. The username or password given to -x or -U did not match; copy them again from the order and watch for special characters in the password.

Do I have to loop cURL to test a whole list of proxies?

Not for a quick health check. The web proxy checker takes up to 100 proxies at once and does not store passwords, and the proxy speed test compares latency without a script.

Private IPv4 that passes the cURL test

One customer per IP, unmetered bandwidth, HTTP(S) with user and password, in 7 countries. Check the live prices.

See live proxy prices

Related articles

Proxies by platform
Proxies for SEO rank tracking: see the results page a local searcher sees
SEO rank tracking proxies with a private IPv4 in the US, UK, Vietnam, Japan and four more markets, so rankings, local packs and ads match what locals see.
Proxies by platform
Proxies for web scraping: a fixed pool of IPs with unmetered traffic
Web scraping proxies for Python, Scrapy, Playwright and Selenium: a pool of private IPv4 and static ISP addresses, unlimited bandwidth, flat per-IP pricing.
Proxy setup
Configuring a Proxy on Ubuntu and Debian, Layer by Layer
Configure an HTTP(S) proxy on Ubuntu or Debian for every layer that needs it: shell variables, APT, systemd services, sudo and the GNOME desktop settings.
Free tools
Check proxies in bulk: status, exit IP and latency
Free online proxy checker: paste up to 100 ip:port:user:pass lines and see which proxies work, their exit IP and latency, plus what each failure result means.
IPV4 · vietnam
Vietnamese IPv4 at Volume: One Fixed IP per Account Without the ISP Price
Vietnam private IPv4 proxies: static Vietnamese datacenter IPs, one customer each, priced for volume. For seeding profiles, secondary Shopee shops and tools.
IPV4 · united states
Build a US IP Pool for Scraping, Rank Tracking and Ad Checks
Buy US private IPv4 proxies: static American datacenter IPs, one customer per IP, unlimited bandwidth. Built for scraping, SERP tracking and US ad checks.
Knowledge base
Checking a Proxy: A Three-Pass Test Before Real Work
Check a proxy in three passes: does it connect, which IP and country do websites see, and is the browser leak-free. Free checker, curl commands and error fixes.
Use cases
Designing a scraper around a pool of dedicated IPs
Web scraping proxies for data teams: size a pool of private static IPs, rotate them in your own code, choose IPv4, ISP or IPv6, and collect data responsibly.