Skip to content
Get Started
G2G2
4.7/5
Excellent
Trustpilot

How to use a proxy with HTTPie

Pass --proxy once per URL scheme: http --proxy=http:http://USERNAME:PASSWORD@HOST:PORT --proxy=https:http://USERNAME:PASSWORD@HOST:PORT https://api.ipify.org. HTTPie also reads HTTP_PROXY, HTTPS_PROXY and ALL_PROXY, and accepts socks5h:// proxy URLs for SOCKS5 on static ISP proxies.

  • Session Control
  • High Speed
  • Privacy First

What you need

HTTPie is a friendlier cURL for testing APIs and reading responses. It runs on Python Requests, so its proxies follow Requests rules: one mapping per scheme of the URL you call, with the proxy URL after the colon. The usual mistake is mapping only http:, which sends HTTPS calls out directly.

Your credential line

From the dashboard's proxy manager: host (or IP), port, username and password. Convert lists with the proxy list formatter.

HTTPie ready

  • HTTPie CLI 3.x (pip install httpie, brew install httpie or your package manager); check with http --version.
  • SOCKS5 support comes from HTTPie's requests[socks] dependency. If an install left it out, run pip install -U "requests[socks]" in HTTPie's environment.

Which proxy fits HTTPie?

Both products use the same setup in HTTPie. What changes is how long an IP stays with you.

HTTPie opens a new connection on every run, so a rotating line normally returns a different residential IP each time; run the IP check twice to see it change. Use a sticky line to keep one IP across a short series of calls.

starting from$0.63/GB

Residential IPs in 190+ countries with country, state and city targeting. Rotate on every request or hold a sticky session for up to 90 minutes; GB never expire.

An ISP line is one dedicated US IP, so a named HTTPie session plus the same ISP proxy on every call gives an account one stable address and one cookie jar. SOCKS5 works on these lines too.

starting from$0.75/IP

Dedicated static IPs registered to US and Canadian ISPs. The address stays the same for as long as you hold it, with unlimited bandwidth and HTTP(S) or SOCKS5 access.

credentials

Your CleanProxies credentials

Every product connects over HTTP(S); static ISP and ISP subnet proxies also run SOCKS5 and IP whitelisting. This is what the dashboard gives you to paste into HTTPie.

Static ISP and ISP subnetHTTP(S)SOCKS5IP whitelist
IP:PORT:USER:PASS

One line per dedicated IP. With IP whitelisting on, the line is just IP:PORT and no password is sent.

Rotating residential and mobileHTTP(S)User:pass
HOST:PORT:USER:PASS

Generated in the proxy manager. The username carries the location and session you pick, so generate a new list to change them.

As a URL, for code and most toolshttp://USERNAME:PASSWORD@HOST:PORTsocks5://USERNAME:PASSWORD@HOST:PORT

Use http:// even for HTTPS websites; the TLS session still runs end to end. The socks5:// form is for static ISP and ISP subnet proxies.

How to set up CleanProxies in HTTPie

Four steps, then check the exit IP with the free proxy checker.

  1. 1

    Install HTTPie

    Install the CLI and run http --version to confirm it works.

  2. 2

    Build the proxy URL

    Turn your dashboard line into http://USERNAME:PASSWORD@HOST:PORT.

  3. 3

    Map both schemes

    Add --proxy=http:URL and --proxy=https:URL. The part before the first colon is the scheme of the website you call.

  4. 4

    Send a test request

    Call https://api.ipify.org with --body; the output is your exit IP.

copy & paste

HTTPie proxy examples

Replace the highlighted placeholders with the values from your dashboard. Pick an example to see its code.

HTTPie + CleanProxies

HTTPie proxy commands

HTTP(S) proxy for both schemesShell
http --proxy=http:http://USERNAME:PASSWORD@HOST:PORT \
     --proxy=https:http://USERNAME:PASSWORD@HOST:PORT \
     https://api.ipify.org format==json
  • format==json is HTTPie syntax for a query parameter. Percent-encode @ or : in a password (@ becomes %40). SOCKS5 is switched on per ISP proxy list in your dashboard and uses the same username and password.
fix it fast

Troubleshooting HTTPie proxy errors

Verify your exit IP

--body prints only the response, so the command below prints the exit IP. Run it again without --proxy (and with no proxy variables set) to compare with your own address.

Open What is my IP? through the proxy to see the address and headers a website receives, or paste up to ten lines into the free proxy checker to test connectivity, latency and exit IP.

Still stuck? Our 24/7 support team answers fast: contact us with the error and the line you used (leave the password out).

HTTPie error fixes
  • ProxyError: Tunnel connection failed: 407 Proxy Authentication RequiredWhy: Wrong credentials, or special characters in the password breaking the URL.Copy the line again and percent-encode the password.
  • HTTPS calls return your real IPWhy: Only --proxy=http:... is set.Add --proxy=https:http://USERNAME:PASSWORD@HOST:PORT.
  • SSLError: wrong version numberWhy: The proxy URL after the colon starts with https://.Use http:// for the proxy itself; HTTPS sites still tunnel securely.
  • Missing dependencies for SOCKS supportWhy: PySocks isn't installed in the environment HTTPie runs in.pip install -U "requests[socks]" there (with pipx: pipx inject httpie pysocks).

HTTPie proxy guides

Setup guides and best practices from the CleanProxies blog.

Get the latest insightsAll Blogs

More integrations

Setup guides for tools people run next to HTTPie.

Proxies for sites people reach with HTTPie
All integrations

HTTPie proxy FAQs

Straight answers about running CleanProxies in HTTPie.

The first part is the scheme of the website you request, the rest is the proxy URL. https:http://HOST:PORT means requests to https sites go through an HTTP proxy, which is the normal setup for CleanProxies.

Got more questions?All FAQs