Integrations menu
Developer guide

Wget Proxy Setup: Step by Step

To run wget through a proxy, set https_proxy and http_proxy to the proxy's HTTP address and give wget the login, ideally from a ~/.wgetrc file with chmod 600 so the password stays out of your shell history and ps: with ProxyField that address is http://gate.proxyfield.io:7000, and wget -qO- https://api.ipify.org then prints the proxy's IP. GNU Wget takes HTTP proxies only, not SOCKS5; for SOCKS5, run it through proxychains4 or use curl. ProxyField residential proxies for wget cost from $1.95/GB ($2.95/GB for 1 GB), with a 99.6% success rate, according to our service data. Start with the Easy Trial: 1 GB for $2.95, no subscription, and the traffic never expires.

residential IPs
412M+
from, traffic never expires
$1.95/GB
Easy Trial
1 GB for $2.95
gate.proxyfield.io:7000
What goes in wget's settings
wget settingProxyField value
http_proxy, https_proxyhttp://gate.proxyfield.io:7000 in both, even for https:// sites
proxy_user, --proxy-user<login>-country-us-city-new_york; the optional keys are -country-<cc>, -region-<region>, -city-<city>, -session-<id> and -ttl-<seconds> (30 to 129,600 s, 20 min when ttl is left out); add -mobile or -dc right after the login for mobile or rotating datacenter IPs (-dc takes the country only)
proxy_password, --proxy-passwordyour ProxyField password; keep it in ~/.wgetrc with chmod 600 so it stays out of shell history and ps
Protocolsthe gateway serves HTTP, HTTPS and SOCKS5 on the same host and port; wget uses the HTTP side
SOCKS5GNU Wget has no SOCKS support; for SOCKS5, run wget through proxychains4, or use curl with socks5h:// and the same username and password
No passwordadd the machine's IP to the allowlist (up to 100 IPv4 addresses), use the port you set up in the dashboard and drop proxy_user and proxy_password
IP behavioura new IP on every request, or one IP for 30 s to 36 h with -session-<id>-ttl-<seconds>, for example one IP for a whole wget -r job
Headersthe gateway adds no Via, X-Forwarded-For or Forwarded header; the headers wget sends pass through; your Proxy-Authorization is removed before the request goes to the site
Credentialsin your ProxyField account, with the allowlist and the configurator (it generates as many proxy lines as you need)

Set up wget with ProxyField

  1. Write use_proxy, http_proxy, https_proxy, proxy_user and proxy_password to ~/.wgetrc.
  2. Run chmod 600 ~/.wgetrc so only you can read the password.
  3. Test with wget -qO- https://api.ipify.org: it prints the proxy's IP, not yours.
  4. Change the location for one run with --proxy-user="<login>-country-de"; wget keeps the password from the file.

The whole setup as one shell snippet, with a New York exit IP.

Shell
cat > ~/.wgetrc <<'EOF'
use_proxy = on
http_proxy = http://gate.proxyfield.io:7000
https_proxy = http://gate.proxyfield.io:7000
proxy_user = <login>-country-us-city-new_york
proxy_password = <password>
EOF
chmod 600 ~/.wgetrc

GNU Wget's own page on proxies: Proxies (GNU Wget Manual).

Mobile 5G/4G proxies cost $3.45/GB for 1 GB down to $2.45/GB from 1,000 GB, on the same gateway and the same balance.

Written for GNU Wget 1.21 or later on Linux and macOS.

Wget proxy options at a glance

Option or settingWhat it does
http_proxy, https_proxythe proxy for http:// and https:// URLs (environment or .wgetrc)
-e use_proxy=yesturns proxy use on (the default when a proxy is set)
--proxy-user, --proxy-passwordthe proxy's username and password
proxy_user, proxy_passwordthe same, in .wgetrc
--config=FILEread this .wgetrc-style file instead of ~/.wgetrc
--no-proxyignore every proxy setting for this run
no_proxyhosts that skip the proxy
On this page 12 sections

1. Set up wget with a proxy in three steps

  1. Put the proxy and the password in a file only you can read:
Shell
cat > ~/.wgetrc <<'EOF'
use_proxy = on
http_proxy = http://gate.proxyfield.io:7000
https_proxy = http://gate.proxyfield.io:7000
proxy_user = <login>-country-us
proxy_password = <password>
no_proxy = localhost,127.0.0.1
EOF
chmod 600 ~/.wgetrc
  1. Test it: wget -qO- https://api.ipify.org prints the proxy's IP, not your machine's. -qO- sends the page to the terminal instead of a file.
  2. Download as usual. Every wget run now goes through the proxy. To change the location for one run, pass only the username: wget --proxy-user="<login>-country-de" URL; wget still takes the password from the file.

The proxy URL starts with http:// even for https:// sites: that is how wget talks to the proxy, and the site's TLS runs through a tunnel. The system-wide file is /etc/wgetrc (sometimes /usr/local/etc/wgetrc); wget reads it first, then yours, and the WGETRC variable or --config=FILE points it at another file.

For a one-off test on a machine where you don't mind the password in history, everything also fits on one line: wget -qO- -e https_proxy=http://gate.proxyfield.io:7000 --proxy-user="<login>-country-us" --proxy-password="<password>" https://api.ipify.org.

2. Keep the proxy password out of shell history and ps

A password typed on the command line lands in your shell history, and while wget runs, anyone on the machine can read it in the process list (ps), as the GNU Wget manual's security notes warn. Where each method leaves the password:

How you pass the proxy passwordShell historyps while wget runs
--proxy-password=... or -e proxy_password=...YesYes
http://<login>:<password>@... in -e https_proxy=...YesYes
export https_proxy=http://<login>:<password>@... typed in the shellYesNo
~/.wgetrc or --config=FILE with chmod 600NoNo
read -rs into a variable, then the variable in https_proxyNoNo
ProxyField IP allowlist (no password at all)Nothing to leakNothing to leak

The variable route, for scripts or a shared machine where you don't want a file:

Shell
read -rsp "Proxy password: " PF_PASS; echo
https_proxy="http://<login>-country-us:${PF_PASS}@gate.proxyfield.io:7000" wget -qO- https://api.ipify.org

History records ${PF_PASS}, not its value. Encode special characters in the password inside the URL (@ becomes %40). The allowlist route: add the machine's IP in your ProxyField account, then wget -e https_proxy=http://gate.proxyfield.io:<port> URL needs no login, where <port> is the port you set up in the dashboard.

In bash with HISTCONTROL=ignorespace (or ignoreboth), a command that starts with a space is not saved to history, but it still shows in ps; it is a fallback, not a fix. Option reference: GNU Wget, HTTP options.

3. http_proxy or https_proxy?

Both. Wget picks the variable by the scheme of the URL you download: http_proxy for http:// URLs, https_proxy for https:// URLs. With only http_proxy set, HTTPS downloads go direct, which is the most common reason wget seems to ignore the proxy. Set both to the same http://gate.proxyfield.io:7000.

4. SOCKS5 with wget: proxychains or curl

GNU Wget has no SOCKS support: http_proxy and https_proxy take HTTP proxies only. ProxyField serves HTTP, HTTPS and SOCKS5 on the same gate.proxyfield.io:7000 with the same login, so wget simply uses the HTTP side. When the job must go over SOCKS5, you have two routes.

proxychains4 + wget, when you need wget's recursive downloads. Write a config file with the gateway's IP address (getent hosts gate.proxyfield.io prints it; proxychains expects an IP in [ProxyList]):

# pf-socks.conf  (chmod 600: it holds the password)
strict_chain
proxy_dns
[ProxyList]
socks5 <gateway IP> 7000 <login>-country-us <password>
Shell
proxychains4 -q -f ./pf-socks.conf wget -qO- https://api.ipify.org

proxy_dns resolves host names through the proxy. proxychains forwards TCP connections only, which is all wget uses. Installing it and the system-wide config are on Linux proxy setup.

curl, for single files: it speaks SOCKS5 natively, and socks5h:// resolves the host name through the proxy:

Shell
curl -x "socks5h://<login>-country-us:${PF_PASS}@gate.proxyfield.io:7000" -o file.zip https://example.com/file.zip

SOCKS5 in general: SOCKS5 proxies; curl's options: cURL with a proxy.

5. Large recursive downloads: one IP for the whole job

For wget -r or --mirror on a site that ties a session or cookie to the IP, put a session id and a session time in the username; the password stays in the file:

Shell
wget --proxy-user="<login>-country-us-session-mirror01-ttl-86400" \
  --recursive --level=5 --no-parent --continue \
  --wait=1 --random-wait --limit-rate=2m \
  https://example.com/docs/
Read moreShow less

-session-mirror01-ttl-86400 keeps one IP for up to 24 hours; ttl goes up to 129,600 seconds (36 h). What to know before a long job:

  • The IP is held while its exit node is up. If the node drops, the gateway retries once with a new session, so the IP may change; a connection that breaks is not restored, and wget reconnects. --continue then resumes partial files instead of starting over.
  • An IP idle for 120 seconds is replaced. Keep --wait well under 120 seconds; a pause longer than that continues on a new IP.
  • Pace it. --wait=1 --random-wait and --limit-rate keep the job within the site's rules. Wget follows robots.txt on recursive downloads by default.

One fixed IP for days or weeks: a dedicated ISP proxy is a private IP for a 30-day term, renewed by you in your dashboard, with no auto-billing, from $2.29 per IP. A dedicated datacenter IPv4 costs $1.39 per IP for 30 days, for sites that accept datacenter IPs. Bandwidth on per-IP products: unlimited traffic on dedicated datacenter IPv4 and dedicated ISP IPs

What a mirror costs on per-GB proxies: everything wget downloads through the proxy counts against your balance. 1 GB costs $2.95; 100 GB costs $249 at $2.49/GB (the tier rate applies to the whole purchase); from 1,000 GB the rate is $1.95/GB. Rotating datacenter proxies cost $0.29/GB down to $0.22/GB from 1,000 GB. Use --reject, --accept and --level to fetch only what you need.

6. Check that wget uses the proxy

  1. wget -qO- https://api.ipify.org prints the exit IP; it should not be your machine's.
  2. wget -qO- https://ipinfo.io/json shows the IP's city and country.
  3. Without -q, wget's output shows Connecting to gate.proxyfield.io ...:7000... connected. when the proxy is in use, and the site's host when it isn't.
  4. env | grep -i proxy and cat ~/.wgetrc show what wget will read.

7. Turn the proxy off

wget --no-proxy URL ignores every proxy setting for one run. For hosts that should always skip it, list them in no_proxy (no_proxy=localhost,127.0.0.1,.internal). To stop entirely, unset http_proxy https_proxy and remove the lines from .wgetrc.

8. BusyBox wget, Windows and scripts

BusyBox wget (Alpine and many Docker images) reads http_proxy and https_proxy but has far fewer options than GNU Wget: no --proxy-user, so put the login in the proxy URL, and test it. For the full option set, install GNU Wget (apk add wget). On Windows, set the same variables in the shell (set https_proxy=http://<login>:<password>@gate.proxyfield.io:7000), or see Windows proxy setup. From Python, prefer the requests library over calling wget: see Python with a proxy.

Fix wget proxy errors

What wget reportsLikely causeFix
Proxy tunneling failed: Proxy Authentication Requiredwget sent no login, or one the proxy did not accept (HTTP's generic 407 status)Check proxy_user and proxy_password, or use the IP allowlist
HTTPS downloads skip the proxyOnly http_proxy is setSet https_proxy too
Unable to resolve host address 'gate.proxyfield.io'A typo, or no DNS on the machineCheck the host; test DNS
Connection refused or a timeoutWrong port, or a firewall blocks the outgoing proxy portPort 7000 with a login, or the port you set up in the dashboard for the allowlist; open it
The proxy is ignored for one hostThe host is in no_proxyRemove it from the list
sudo wget skips the proxysudo drops your environmentsudo -E wget, or use /etc/wgetrc
A site returns 403The site refuses the request or the IPTry another city or a new session; slow down with --wait

The gateway's own error responses: 407 Proxy Authentication Required for a wrong login or password, an IP not on the allowlist or a malformed location, 402 Payment Required when no traffic is left and 502 Bad Gateway when no exit could be connected; a restricted site gets no separate response, and a 403 comes from the site itself. HTTP status codes are explained in proxy errors. Our 24/7 live chat helps with setup and integration.

Which proxies to use with wget

What you downloadProxyPrice
Public pages and files, by country or cityRotating residential$2.95/GB for 1 GB, down to $1.95/GB from 1,000 GB
What mobile users getMobile 5G/4G$3.45/GB for 1 GB, down to $2.45/GB
Large files from sites that accept datacenter IPsDatacenter$0.29/GB down to $0.22/GB
One fixed IP for days or weeks, or a server that allowlists one IPDedicated ISPfrom $2.29 per IP per 30 days

For requests, headers and APIs rather than downloads, cURL with a proxy has more options. Use ProxyField for lawful work such as public web data collection and testing: public pages only, and follow each site's terms.

Get started

Start with the Easy Trial: 1 GB for $2.95, with no minimum purchase and no subscription. The traffic never expires and all purchases are final. See pricing per GB.

Wget Proxy Setup FAQ

How do I use wget with a proxy?

ProxyField proxies work with wget from $1.95/GB ($2.95 for 1 GB): set http_proxy and https_proxy to http://gate.proxyfield.io:7000 and put proxy_user and proxy_password in ~/.wgetrc with chmod 600. wget -qO- https://api.ipify.org then prints the proxy's IP.

How do I use a proxy with wget for a single command?

Pass the settings with -e: wget -e use_proxy=yes -e https_proxy=http://gate.proxyfield.io:7000 --proxy-user=<login> --proxy-password=<password> URL. Nothing is saved after the run, but the password shows in your history and in ps, so use it only for a quick test.

How do I set a proxy server for wget permanently?

Add use_proxy = on, http_proxy, https_proxy, proxy_user and proxy_password lines to ~/.wgetrc, then chmod 600 the file. Wget reads it on every run.

Where is the wgetrc file?

Your own is ~/.wgetrc; the system-wide one is /etc/wgetrc or /usr/local/etc/wgetrc. The WGETRC environment variable or --config=FILE points wget at another file.

How do I pass a proxy username and password to wget?

Use proxy_user and proxy_password in .wgetrc, or --proxy-user=<login> --proxy-password=<password> on the command line. The URL form http://<login>:<password>@gate.proxyfield.io:7000 also works; encode special characters in it.

How do I pass a proxy username and password to wget without leaving them in my shell history?

Keep them in a file: proxy_user and proxy_password in ~/.wgetrc (or a file given with --config=FILE) with chmod 600. Or read the password with read -rs PF_PASS and use https_proxy="http://<login>:${PF_PASS}@gate.proxyfield.io:7000"; neither leaves it in history or ps. With ProxyField you can also allowlist the machine's IP and use no password at all, on the port you set up in the dashboard.

How do I use a proxy password with special characters in wget?

Encode them inside the proxy URL: @ in the password becomes %40 in http://<login>:<password>@gate.proxyfield.io:7000. Or keep the password out of the URL with proxy_password in ~/.wgetrc (with chmod 600) or --proxy-password=<password> on the command line.

Should I use http_proxy or https_proxy with Wget?

Both: wget uses http_proxy for http:// URLs and https_proxy for https:// URLs. Set both to http://gate.proxyfield.io:7000.

Why does wget ignore my http_proxy for HTTPS sites?

Because HTTPS URLs read https_proxy, not http_proxy. Set https_proxy as well and run the command again.

Why is Wget not using my proxy?

Usually https_proxy is missing, the host is in no_proxy, use_proxy is off in a .wgetrc, or sudo dropped your environment. Run env | grep -i proxy and check that the output says Connecting to gate.proxyfield.io.

Show 15 more questionsShow fewer questions

What does use_proxy do in wget?

It turns proxy use on or off; it is on by default whenever a proxy is set. -e use_proxy=no or --no-proxy makes one run go direct.

Does wget support SOCKS5 proxies, or do I need proxychains or curl for that?

GNU Wget does not support SOCKS5; it takes HTTP proxies only. Use proxychains4 when you need wget's recursive downloads over SOCKS5, or curl with socks5h:// for single files. ProxyField serves SOCKS5 and HTTP on the same gate.proxyfield.io:7000, so wget can also just use the HTTP side.

How do I use wget with a SOCKS5 proxy?

Wrap it in proxychains: put socks5 <gateway IP> 7000 <login> <password> under [ProxyList] in a config file, add proxy_dns, and run proxychains4 -q -f ./pf-socks.conf wget URL. proxychains forwards TCP only, which covers wget.

Which proxy providers suit wget for large recursive downloads where I need one sticky IP the whole time?

ProxyField gives you two options: a sticky session on rotating residential proxies from $1.95/GB, held up to 36 h with -session-<id>-ttl-<seconds> in the username, or a dedicated ISP IP from $2.29 per IP for 30 days. A sticky IP is held while its exit node is up and is replaced after 120 s idle, so keep --wait short and use --continue; for a job that runs for days, the dedicated IP is the fixed one.

Should I use rotating or sticky proxies for wget -r?

Sticky, when the site ties a session or cookie to the IP: a session id in the username keeps one IP for up to 36 h while its exit node is up, and an IP idle for 120 s is replaced. For independent public files, rotation per request is fine.

Can I rotate IPs automatically with Wget?

Yes, without any script: ProxyField's gateway gives a new IP on every request when the username has no session. Wget only needs the one proxy URL.

Does the proxy setup work with BusyBox wget (Alpine, Docker)?

Partly: BusyBox wget reads http_proxy and https_proxy but has no --proxy-user, so the login goes in the proxy URL. Install GNU Wget with apk add wget for the full options.

How do I check that wget is really going through the proxy?

Run wget -qO- https://api.ipify.org and compare the IP with your own. Without -q, the output shows Connecting to gate.proxyfield.io ...:7000.

How do I stop wget from using a proxy?

Add --no-proxy for one run. To stop for good, unset http_proxy https_proxy and remove the proxy lines from .wgetrc.

How do I bypass the proxy for specific domains with wget (no_proxy)?

List them in no_proxy, comma-separated, in the environment or .wgetrc: no_proxy=localhost,127.0.0.1,.internal. A leading dot covers the subdomains.

What is a wget proxy?

An HTTP proxy that wget sends its downloads through, set with http_proxy and https_proxy. The site then sees the proxy's IP and location instead of yours.

What is the difference between wget and curl?

wget downloads files and whole sites, recursively if you ask; curl sends single requests with full control over methods, headers and protocols, including SOCKS5. Both take ProxyField's proxy; see cURL with a proxy.

What is Wget?

GNU Wget is a command-line program that downloads files over HTTP, HTTPS and FTP, and can mirror sites recursively. It is preinstalled on most Linux systems.

Why use residential proxies for Wget instead of datacenter IPs?

Some sites limit or block datacenter IPs, and residential IPs from home ISPs pass where those don't. For large files from sites that accept datacenter IPs, datacenter proxies at $0.22/GB from 1,000 GB cost less.

Is it safe to use free proxies with wget?

Not for anything private: a free public proxy can read or alter unencrypted downloads, and you don't know who runs it. ProxyField has no free proxies; the smallest purchase is 1 GB for $2.95.

Easy Trial: 1 GB for $2.95.

Try for the price of 1 GB, no subscription, traffic never expires.