Set up wget with ProxyField
- Write
use_proxy,http_proxy,https_proxy,proxy_userandproxy_passwordto~/.wgetrc. - Run
chmod 600 ~/.wgetrcso only you can read the password. - Test with
wget -qO- https://api.ipify.org: it prints the proxy's IP, not yours. - 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.
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 ~/.wgetrcGNU 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.
Wget proxy options at a glance
| Option or setting | What it does |
|---|---|
http_proxy, https_proxy | the proxy for http:// and https:// URLs (environment or .wgetrc) |
-e use_proxy=yes | turns proxy use on (the default when a proxy is set) |
--proxy-user, --proxy-password | the proxy's username and password |
proxy_user, proxy_password | the same, in .wgetrc |
--config=FILE | read this .wgetrc-style file instead of ~/.wgetrc |
--no-proxy | ignore every proxy setting for this run |
no_proxy | hosts that skip the proxy |
On this page 12 sections
1. Set up wget with a proxy in three steps
- Put the proxy and the password in a file only you can read:
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- Test it:
wget -qO- https://api.ipify.orgprints the proxy's IP, not your machine's.-qO-sends the page to the terminal instead of a file. - 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 password | Shell history | ps while wget runs |
|---|---|---|
--proxy-password=... or -e proxy_password=... | Yes | Yes |
http://<login>:<password>@... in -e https_proxy=... | Yes | Yes |
export https_ typed in the shell | Yes | No |
~/.wgetrc or --config=FILE with chmod 600 | No | No |
read -rs into a variable, then the variable in https_proxy | No | No |
| ProxyField IP allowlist (no password at all) | Nothing to leak | Nothing to leak |
The variable route, for scripts or a shared machine where you don't want a file:
read -rsp "Proxy password: " PF_PASS; echo
https_proxy="http://<login>-country-us:${PF_PASS}@gate.proxyfield.io:7000" wget -qO- https://api.ipify.orgHistory 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>proxychains4 -q -f ./pf-socks.conf wget -qO- https://api.ipify.orgproxy_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:
curl -x "socks5h://<login>-country-us:${PF_PASS}@gate.proxyfield.io:7000" -o file.zip https://example.com/file.zipSOCKS5 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:
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.
--continuethen resumes partial files instead of starting over. - An IP idle for 120 seconds is replaced. Keep
--waitwell under 120 seconds; a pause longer than that continues on a new IP. - Pace it.
--wait=1 --random-waitand--limit-ratekeep the job within the site's rules. Wget followsrobots.txton 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
wget -qO- https://api.ipify.orgprints the exit IP; it should not be your machine's.wget -qO- https://ipinfo.io/jsonshows the IP's city and country.- Without
-q, wget's output showsConnecting to gate.proxyfield.io ...:7000... connected.when the proxy is in use, and the site's host when it isn't. env | grep -i proxyandcat ~/.wgetrcshow 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 reports | Likely cause | Fix |
|---|---|---|
Proxy tunneling failed: Proxy Authentication Required | wget 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 proxy | Only http_proxy is set | Set https_proxy too |
Unable to resolve host address 'gate. | A typo, or no DNS on the machine | Check the host; test DNS |
Connection refused or a timeout | Wrong port, or a firewall blocks the outgoing proxy port | Port 7000 with a login, or the port you set up in the dashboard for the allowlist; open it |
| The proxy is ignored for one host | The host is in no_proxy | Remove it from the list |
sudo wget skips the proxy | sudo drops your environment | sudo -E wget, or use /etc/wgetrc |
| A site returns 403 | The site refuses the request or the IP | Try 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 download | Proxy | Price |
|---|---|---|
| Public pages and files, by country or city | Rotating residential | $2.95/GB for 1 GB, down to $1.95/GB from 1,000 GB |
| What mobile users get | Mobile 5G/4G | $3.45/GB for 1 GB, down to $2.45/GB |
| Large files from sites that accept datacenter IPs | Datacenter | $0.29/GB down to $0.22/GB |
| One fixed IP for days or weeks, or a server that allowlists one IP | Dedicated ISP | from $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.