Proxy in cURL: one command

cURL is the fastest way to check that a proxy works. Below are commands for HTTP and SOCKS5 with a password.

HTTPHTTPSSOCKS4SOCKS5Login and passwordRotation and sticky
cURL · proxy
http://HOST:PORT
LOGIN:••••••
socks5h://HOST:PORT
✓ IP: Germany, residentialRun

Why use a proxy in cURL

cURL is a command line tool for URL requests. The proxy is set with -x (--proxy), login and password with -U (--proxy-user). The proxy type comes from the scheme: http://, socks5://, socks5h://.

What to pick

HTTP is fine for a quick check. If you need SOCKS5, use socks5h:// so the proxy resolves names. Rotation is easy to check by running the same request a few times: the IP should change, and stay the same on a sticky session.

Residential

from $0.6 / GB

Home ISP addresses. The main choice for accounts and protected sites.

VIP

$2 / GB

Hand-picked clean IPs, faster and more stable than regular residential.

Mobile

$4 / GB

Carrier IPs, for platforms that check addresses strictly.

Step-by-step setup

Button names are given exactly as they appear in cURL.

  1. Make sure cURL is there

    Run curl --version. Linux and macOS usually have it; Windows 10 and newer ship it too.

  2. Export the proxy

    Take host, port, login and password in @SousProxyBot or the dashboard. Convert the line format with /en/tools/proxy-converter/ if needed.

  3. Build the command

    The proxy address goes into -x, login and password into -U LOGIN:PASSWORD. Quote the target URL, otherwise the shell trips over the ? sign.

  4. Run it

    Run the command from the example. The -v flag shows which proxy cURL connected to and what it answered.

  5. Check the IP

    The response is JSON with an address. That's the proxy IP if everything is set up right.

Code example

Put in your own HOST, PORT, LOGIN and PASSWORD from the bot or the dashboard.

bash
# HTTP proxy
curl -x http://HOST:PORT -U LOGIN:PASSWORD "https://api.ipify.org?format=json"

# SOCKS5, DNS through the proxy
curl -x socks5h://HOST:PORT -U LOGIN:PASSWORD "https://api.ipify.org?format=json"

# Same thing in one line
curl -x "http://LOGIN:PASSWORD@HOST:PORT" "https://api.ipify.org?format=json"

Tested by running it

We ran this example ourselves: curl 8.5.0 (OpenSSL 3.0.13). Real output below, IP hidden.

Terminal ·
$ curl -x http://HOST:PORT -U LOGIN:PASSWORD "https://api.ipify.org?format=json"
{"ip":"proxy IP"}

And this is the response when the password is wrong:

$ curl -x http://HOST:PORT -U LOGIN:wrong-pass "https://api.ipify.org?format=json"
curl: (56) CONNECT tunnel failed, response 407

Common errors

The issues people most often bring to support.

!

HTTP/1.1 407 Proxy Authentication RequiredThe login or password didn't get through. Check -U and escape special characters in the password or quote it.

!

curl: (7) Failed to connect to HOST port PORTWrong host or port, or the port is blocked by a firewall. Compare the details in the dashboard and test the proxy on /en/tools/proxy-checker/.

!

The response came with your IPNO_PROXY may have kicked in, or -x didn't make it into the command. Run with -v and look at the connection line.

!

zsh: no matches foundThe shell expands ? in the URL. Quote the address.

Need a proxy for cURL?

Residential, VIP and mobile IPs. HTTP and SOCKS5, pay per GB, 1 GB free to try.

FAQ

What's the difference between socks5:// and socks5h://?

With socks5 cURL resolves the domain itself; with socks5h the name goes to the proxy. The second doesn't expose your DNS.

Can I skip the proxy in every command?

Yes, cURL reads the http_proxy, https_proxy and ALL_PROXY environment variables. The -x option overrides them.

How do I check rotation?

Run the command several times in a row. With rotation the IP changes; with a sticky session it stays the same.