Skip to content
Get Started
G2G2
4.7/5
Excellent
Trustpilot

How to use a proxy with Wget

Set the proxy for one command with -e: wget -qO- -e use_proxy=yes -e https_proxy=http://USERNAME:PASSWORD@HOST:PORT https://api.ipify.org. Wget also reads the http_proxy and https_proxy environment variables and ~/.wgetrc. It has no SOCKS support, so use cURL for SOCKS5.

  • Session Control
  • High Speed
  • Privacy First

What you need

Wget is the standard tool for scripted downloads and mirroring on Linux servers. It supports HTTP(S) proxies with Basic authentication, which every CleanProxies product offers, but it only reads the lower-case proxy variables and has no SOCKS option at all.

Your credential line

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

Wget ready

  • GNU Wget 1.x (wget --version). Some newer Linux distributions install GNU Wget2 under the wget name; its credential flags differ (see Troubleshooting).

Which proxy fits Wget?

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

Each wget run opens fresh connections, so a rotating line normally gives every run a new residential IP; within one --input-file run, files from the same host can share a connection and an IP. Use a sticky line when a series of downloads must finish on one IP.

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.

Each ISP line is one dedicated US IP, so every wget run through it exits from the same address all month. That suits scheduled downloads from sites that rate-limit or allow-list by IP.

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 Wget.

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 Wget

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

  1. 1

    Copy one proxy line

    Take a rotating residential line, or an ISP line, from your CleanProxies dashboard.

  2. 2

    Build the proxy URL

    Write it as http://USERNAME:PASSWORD@HOST:PORT, or keep http://HOST:PORT and pass the credentials as flags.

  3. 3

    Run a test download

    Run wget -qO- -e use_proxy=yes -e https_proxy=http://USERNAME:PASSWORD@HOST:PORT https://api.ipify.org. It prints the exit IP.

  4. 4

    Make it permanent

    Export http_proxy and https_proxy, or put the settings in ~/.wgetrc.

copy & paste

Wget proxy examples

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

Wget + CleanProxies

Wget proxy commands

-e runs a .wgetrc command for this call only. use_proxy is already on by default; passing it makes the command work even if a wgetrc turned proxies off.

Proxy on the command lineShell
# credentials inside the proxy URL
wget -qO- -e use_proxy=yes -e https_proxy=http://USERNAME:PASSWORD@HOST:PORT https://api.ipify.org

# credentials as flags (safer for passwords with @ or :)
wget -qO- -e use_proxy=yes -e https_proxy=http://HOST:PORT \
  --proxy-user=USERNAME --proxy-password=PASSWORD https://api.ipify.org
  • Wget uses https_proxy for https:// URLs and http_proxy for http:// URLs, so set both. Both point to an http:// proxy URL; HTTPS downloads still run end to end through a CONNECT tunnel. --no-proxy skips the proxy for one command.

Need SOCKS5? Use cURL

GNU Wget supports HTTP(S) and FTP proxies only; there is no SOCKS option. Every CleanProxies product works with Wget over HTTP(S). If you specifically need SOCKS5, it's available on static ISP and ISP subnet proxies (switched on per proxy list in the dashboard, same username and password): send those requests with cURL and -x socks5h://USERNAME:PASSWORD@HOST:PORT.

fix it fast

Troubleshooting Wget proxy errors

Verify your exit IP

api.ipify.org returns only the IP address. Run the test with and without the proxy flags and compare. Add -d (debug, if your build supports it) to see the CONNECT request and the proxy's reply.

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).

Wget error fixes
  • Proxy tunneling failed: Proxy Authentication RequiredWhy: Wrong username or password, or @ or : in the password breaking the proxy URL.Copy the line again, or pass the credentials with --proxy-user and --proxy-password.
  • HTTPS downloads show your real IPWhy: Only http_proxy is set, or the variables are upper case (Wget reads the lower-case names).Set lower-case https_proxy as well, or pass -e https_proxy=....
  • The proxy is ignored completelyWhy: use_proxy = off in a wgetrc, or the host matches no_proxy.Add -e use_proxy=yes and check env | grep -i proxy.
  • `--proxy-user` is rejected or has no effectWhy: Your wget is GNU Wget2, which doesn't implement --proxy-user.Use --http-proxy-user and --http-proxy-password, or put the credentials in the proxy URL; Wget2 also has --https-proxy.
  • A socks5:// proxy URL doesn't workWhy: Wget has no SOCKS support.Use the HTTP(S) form of your credentials, or cURL for SOCKS5 on ISP proxies.

Wget 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 Wget.

Proxies for sites people reach with Wget
All integrations

Wget proxy FAQs

Straight answers about running CleanProxies in Wget.

No. GNU Wget supports HTTP(S) and FTP proxies only. Use the HTTP(S) form of your CleanProxies credentials with wget, or use cURL when you need SOCKS5, which CleanProxies offers on static ISP and ISP subnet proxies.

Got more questions?All FAQs