This article will walk you through every click and command you need to pair cURL with any proxy—static, rotating, or sticky—so you can scrape, test, or debug from any location without tripping rate limits or geo‑locks.
cURL—short for Client URL—is both a command‑line tool (curl
) and a transferable library (libcurl
) that can send or receive data through more than 20 internet protocols, including HTTP, HTTPS, FTP, IMAP, and SCP. Because it ships with macOS, almost every Linux distribution and with Windows 10 since build 1803, it has become the de‑facto Swiss‑army knife for developers who need to test APIs, download files, scrape pages, or debug network flows. Its popularity also stems from three traits:
-s
), and piping play nicely with Bash, PowerShell, or CI pipelines.Sending requests straight from your own IP is fine for a quick test, but real‑world automation (web scraping, geo‑testing, load simulation) quickly reveals two limits: rate throttling and geolocation locks. Inserting a proxy server between cURL and the destination site changes the game:
Below you’ll find a complete walk‑through, from prerequisites to advanced rotation.
Before typing your first command, make sure you have:
curl --version
; anything older lacks modern TLS fixes.username:password
for paid or authenticated pools.https://httpbin.org/ip
or https://google.com
that echoes your origin, so you can verify the proxy. Premium residential or ISP proxies are ideal for production; free lists break often and can leak traffic.Open Terminal and run:
brew install curl # Homebrew keeps you on the latest release
On most modern Windows machines (Windows 10, version 1803 or later), curl
is already pre-installed. To avoid confusion with PowerShell’s alias for Invoke-WebRequest
, run curl.exe
explicitly to verify:
curl.exe --version
Most distros bundle cURL, but if yours doesn’t:
# Debian / Ubuntusudo apt-get update && sudo apt-get install curl
Check your installation with curl --version
—you should see version, features, and supported protocols.
A minimal proxy call has two ingredients: -x
(or --proxy
) followed by the proxy URL, then the destination URL.
curl -x "http://HOST:PORT" "https://example.com"
Key points:
-x
and --proxy
are identical; pick your style.http://
.1080
for HTTP/SOCKS and 443
for HTTPS proxies.
# HTTPS proxycurl -x "https://proxy.example:33333" "https://example.com"# SOCKS5 proxy (high anonymity)curl -x "socks5://proxy.example:33433" "https://example.com"# Short form for SOCKScurl --socks5 proxy.example:33433 https://example.com
The rest of the command stays identical; only the scheme changes.
Some premium pools guard access by user/password or token. You have two options:
# Embed creds inside the proxy stringcurl -x "http://user:pwd@proxy.example:3128" "https://httpbin.org/ip"# Separate flag keeps the URL cleancurl --proxy-user user:pwd -x http://proxy.example:3128 https://httpbin.org/ip
If the password contains @
or :
, always wrap the entire proxy URL in quotes to stop the shell from misinterpreting it.
Using environment variables lets you route every subsequent curl
command through the same proxy without typing -x
each time.
How it works
http_proxy
– URL of the proxy cURL should use for plain HTTP requests.https_proxy
– URL of the proxy cURL should use for HTTPS requests (yes, the name is a bit confusing—the variable still governs HTTPS).
# General patternexport http_proxy="[<protocol>://][<user>:<pwd>]@<host>[:<port>]"export https_proxy="[<protocol>://][<user>:<pwd>]@<host>[:<port>]"# Concrete example (no auth)export http_proxy="http://2.59.20.37:33333"export https_proxy="http://2.59.20.37:33333"
From now on, every curl
you run in that shell inherits the proxy:
curl https://httpbin.org/ip
returns something like:
{"origin": "2.59.20.37"}
Turn the proxy off by un‑setting the variables:
unset http_proxyunset https_proxy
Your next request will hit the internet directly again.
# General pattern$env:http_proxy = "[<protocol>://][<user>:<pwd>]@<host>[:<port>]"$env:https_proxy = "[<protocol>://][<user>:<pwd>]@<host>[:<port>]"# Example$env:http_proxy = "http://user:pwd@2.59.20.37:33333"$env:https_proxy = "http://user:pwd@2.59.20.37:33333"
Important: after setting the variables, call the binary explicitly to avoid PowerShell’s curl
alias:
curl.exe https://httpbin.org/ip
You should again see the proxy’s IP in the JSON response.
Clear the settings when you’re done:
$env:http_proxy = ""$env:https_proxy = ""
curl.exe
(and everything else in that session) now reverts to your real network connection.
.curlrc
shortcutSometimes you need a proxy for cURL and nothing else—no browsers, no Python scripts, no system‑wide variables. That’s exactly what the per‑user cURL configuration file is for.
Open a terminal and jump to your home folder:
cd ~
2. If the file doesn’t exist, create it; otherwise open it for editing:
nano .curlrc
3. Add a single line that tells cURL which proxy to use (credentials optional):
proxy="http://user:pwd@2.59.20.37:33333"
4. Save and exit (Ctrl‑O
, Enter
, Ctrl‑X
in nano). From now on, every plain curl
command in that account automatically tunnels through the proxy:
curl "https://google.com"
The service should return the address your proxy exposes. To override the setting on a one‑off basis, just add --noproxy "*"
, or point -x
at a different endpoint.
Open Command Prompt and discover where your roaming profile lives:
echo %APPDATA%
You’ll see something like:
C:\Users\<your_user>\AppData\Roaming
2. In that folder, create a file called _curlrc (note the leading underscore) and paste the same proxy directive:
proxy="http://user:pwd@2.59.20.37:33333"
3. Save the file. Launch PowerShell, and remember to call the real binary so you bypass PowerShell’s alias:
curl.exe "http://httpbin.org/ip"
You should see the proxy’s IP in the JSON response.
One‑off override:
curl -x "http://2.59.20.37:33333" https://google.com
curl --noproxy "*" https://google.com
These flags ignore any environment variables or .curlrc
.
Sometimes you only need a proxy for five minutes and don’t want to re‑type -x
or touch system‑wide variables. A pair of shell aliases can do the heavy lifting.
Open a terminal and jump to your home folder:
cd ~
2. Create (or edit) .bashrc—the script your shell reads on every new session:
nano .bashrc
3. Drop in two one‑liners that flip the proxy on and off. Replace the URL with your own endpoint (credentials optional):
alias proxyon='export http_proxy="http://2.59.20.37:33333"; \export https_proxy="$http_proxy"'alias proxyoff='unset http_proxy https_proxy'
4. Save the file, reload your profile (source ~/.bashrc
), or just open a fresh terminal.
How to use it
proxyon # turn the proxy oncurl https://httpbin.org/ip # any curl commands you needproxyoff # back to your real network
That’s it—no more copy‑pasting long proxy strings.
PowerShell lets you bind the same logic to quick aliases or functions:
function proxyon { $env:http_proxy = "http://2.59.20.37:33333"$env:https_proxy = $env:http_proxy }function proxyoff { $env:http_proxy = ""$env:https_proxy = "" }# Usageproxyoncurl.exe https://httpbin.org/ip # always call curl.exe, not the aliasproxyoff
These functions live only for the current session; add them to your $PROFILE file if you want them every time PowerShell opens.
--proxy-user
.-k
only while testing.https://
or a CONNECT‑capable tunnel.Not all proxies behave the same. Here’s how they differ:
Be sure that you are logged in to your Anonymous Proxies dashboard account because you will need to copy three things from there—your rotating proxy's IP, your username, and the special password string we generate for you. Now, you just need to copy those values into the template below.
curl -x "http://USERNAME:PROXY_PASSWORD@ROTATING_PROXY_IP:PORT" -l https://httpbin.org/ip
Run the command and the JSON response should show an IP that isn’t yours.
And if you want a sticky IP instead of a new one every call, you just need to flip the “Is Sticky” switch in the dashboard before you copy the auto-generated password.
Mastering proxies in cURL boils down to three flags—-x
, --proxy-user
, and --noproxy
—plus two configuration layers: environment variables ($http_proxy
, $https_proxy
) and an optional .curlrc
file. Combine those basics with the right proxy flavor—datacenter for speed, residential for stealth, or a managed rotating gateway for effortless scale—and you’ll scrape, test, or debug from any corner of the internet without tripping over firewalls, geo‑locks, or anti‑bot shields. Keep the troubleshooting tips handy, automate rotation when workloads grow, and always operate ethically. Follow the steps in this guide and your next curl
command will glide through the web as smoothly as if you were right there on the wire.
@2025 anonymous-proxies.net