---
title: "How to Use Wget With a Proxy: Commands & Examples"
description: "Set up a Wget proxy step by step with commands, environment variables, and wgetrc. Includes proxy authentication, SOCKS5, and troubleshooting."
url: "https://marsproxies.com/blog/wget-proxy/"
---

- [EN ](https://marsproxies.com/blog/wget-proxy/?locale-change "English")
  [CN](https://marsproxies.cn/blog/wget-proxy/?locale-change "Chinese")

[Contact sales](https://marsproxies.com/contact-sales/) [Register](https://dashboard.marsproxies.com/register/) [Log in](https://dashboard.marsproxies.com/login/)

[Contact sales](https://marsproxies.com/contact-sales/) [Register](https://dashboard.marsproxies.com/register/) [Log in](https://dashboard.marsproxies.com/login/)

[Contact sales](https://marsproxies.com/contact-sales/)

[Log in](https://dashboard.marsproxies.com/login/) [Register](https://dashboard.marsproxies.com/register/)

- [EN ](https://marsproxies.com/blog/wget-proxy/?locale-change "English")
  [CN](https://marsproxies.cn/blog/wget-proxy/?locale-change "Chinese")

[Back to blog](https://marsproxies.com/blog/) September 16, 2026

# How to Use Wget With a Proxy: Commands & Examples

[How to](https://marsproxies.com/blog/category/how-to/)

\-

Table of contents

1. [Method 1: use a proxy for one Wget command](https://marsproxies.com/blog/wget-proxy/#b-method-1-use-a-proxy-for-one-wget-command)
2. [Use an HTTP proxy](https://marsproxies.com/blog/wget-proxy/#b-use-an-http-proxy)
3. [Use a proxy for HTTPS requests](https://marsproxies.com/blog/wget-proxy/#b-use-a-proxy-for-https-requests)
4. [Use an authenticated proxy](https://marsproxies.com/blog/wget-proxy/#b-use-an-authenticated-proxy)
5. [Method 2: set Wget proxy environment variables](https://marsproxies.com/blog/wget-proxy/#b-method-2-set-wget-proxy-environment-variables)
6. [Linux and macOS](https://marsproxies.com/blog/wget-proxy/#b-linux-and-macos)
7. [Make proxy variables persistent](https://marsproxies.com/blog/wget-proxy/#b-make-proxy-variables-persistent)
8. [Windows PowerShell](https://marsproxies.com/blog/wget-proxy/#b-windows-powershell)
9. [Method 3: configure a proxy in wgetrc](https://marsproxies.com/blog/wget-proxy/#b-method-3-configure-a-proxy-in-wgetrc)
10. [Configure a proxy for the current user](https://marsproxies.com/blog/wget-proxy/#b-configure-a-proxy-for-the-current-user)
11. [Configure a system-wide proxy](https://marsproxies.com/blog/wget-proxy/#b-configure-a-system-wide-proxy)
12. [Add proxy authentication to wgetrc](https://marsproxies.com/blog/wget-proxy/#b-add-proxy-authentication-to-wgetrc)
13. [Which Wget proxy method should you use?](https://marsproxies.com/blog/wget-proxy/#b-which-wget-proxy-method-should-you-use)
14. [How to check whether Wget is using the proxy](https://marsproxies.com/blog/wget-proxy/#b-how-to-check-whether-wget-is-using-the-proxy)
15. [Bypass the proxy for specific hosts with no\_proxy](https://marsproxies.com/blog/wget-proxy/#b-bypass-the-proxy-for-specific-hosts-with-noproxy)
16. [Does Wget support SOCKS5 proxies?](https://marsproxies.com/blog/wget-proxy/#b-does-wget-support-socks5-proxies)
17. [Use Wget with Proxychains](https://marsproxies.com/blog/wget-proxy/#b-use-wget-with-proxychains)
18. [When another tool may be easier](https://marsproxies.com/blog/wget-proxy/#b-when-another-tool-may-be-easier)
19. [Common Wget proxy errors and fixes](https://marsproxies.com/blog/wget-proxy/#b-common-wget-proxy-errors-and-fixes)
20. [407 Proxy Authentication Required](https://marsproxies.com/blog/wget-proxy/#b-407-proxy-authentication-required)
21. [Connection refused](https://marsproxies.com/blog/wget-proxy/#b-connection-refused)
22. [Wget is ignoring the proxy](https://marsproxies.com/blog/wget-proxy/#b-wget-is-ignoring-the-proxy)
23. [HTTPS certificate errors](https://marsproxies.com/blog/wget-proxy/#b-https-certificate-errors)
24. [Proxy connection times out](https://marsproxies.com/blog/wget-proxy/#b-proxy-connection-times-out)
25. [Wget Proxy command cheat sheet](https://marsproxies.com/blog/wget-proxy/#b-wget-proxy-command-cheat-sheet)
26. [Final thoughts](https://marsproxies.com/blog/wget-proxy/#b-final-thoughts)
27. [Frequently asked questions](https://marsproxies.com/blog/wget-proxy/#b-frequently-asked-questions)

\-

Key takeaways

- Command-line flags are the quickest way to route a single download without changing your system settings.

* Updating your configuration file sets a permanent proxy, which saves you from typing long commands every time.

- Wget does not natively support SOCKS5 proxies, so you will need a wrapper like Proxychains to handle those connections.

GNU Wget is a reliable tool for fetching files from the web, and it works easily with proxies to hide your IP address or bypass local blocks. You can route your traffic through a proxy in three ways: adding a quick flag to your command, setting a temporary shell variable, or saving the details permanently in your configuration file.

```javascript
wget -e use_proxy=yes -e http_proxy=http: / / 192.168 .1 .100 : 8080 https : / / httpbin.org /
```

## Method 1: use a proxy for one Wget command

To route a single download through a proxy server without changing your system proxy settings, you’ll need to append specific flags to your Wget command. It keeps your environment clean since the parameters disappear when the download completes.

### Use an HTTP proxy

Pass the proxy details using the execute flag (-e) twice: once to activate the proxy feature and again to set the proxy address and port.

```typescript
wget -e use_proxy=yes -e http_proxy=http: / / HOST : PORT https: / / httpbin.org /
```

### Use a proxy for HTTPS requests

Secure connections require the https\_proxy variable instead. Note that the proxy URL itself still uses http\://. Wget connects to the proxy in plaintext and then opens an encrypted tunnel to the target using the HTTP CONNECT method. Only use https\:// if your provider explicitly offers a TLS-terminating proxy endpoint.

```typescript
wget -e use_proxy=yes -e https_proxy=http: / / HOST : PORT https: / / httpbin.org /
```

### Use an authenticated proxy

If your proxy requires credentials, add your proxy username and proxy password as separate flags during the proxy configuration. Be careful doing this, as typing plain-text passwords directly into the terminal leaves a permanent record in your shell history.

```typescript
wget -e use_proxy=yes -e http_proxy=http: / / HOST : PORT --proxy-user= USER --proxy-password= PASS https: / / httpbin.org /
```

## Method 2: set Wget proxy environment variables

If you need to run multiple downloads in one terminal session, export your proxy URL and other proxy configuration details as environment variables for GNU Wget. It saves you from typing out flags for every command, and the settings automatically clear out when you close the terminal window.

### Linux and macOS

Use the export command to assign your proxy URL to standard environment variables when using a proxy server. Wget and most other command-line tools will automatically look for these.

```typescript
export http_proxy= "http://HOST:PORT"
export https_proxy= "http://HOST:PORT"
```

### Make proxy variables persistent

To load these variables automatically every time you open a terminal, add the export commands to your shell configuration file, like .bashrc or .zshrc. The system will then apply them whenever it starts up.

### Windows PowerShell

In Windows, you can set session-level variables directly using PowerShell.

```typescript
$env:http_proxy= "http://HOST:PORT"
$env:https_proxy= "http://HOST:PORT"
```

## Method 3: configure a proxy in wgetrc

To use a proxy by default, add your settings to the wgetrc file. It makes your configuration permanent so you do not have to manage shell variables or type out lengthy flags every time you run Wget.

### Configure a proxy for the current user

To apply proxy settings just to your own account, create or edit the hidden .wgetrc file for GNU Wget as part of your proxy configuration.

```typescript
# ~ / .wgetrc
use_proxy = on
http_proxy = http: / / HOST : PORT
https_proxy = http: / / HOST : PORT
```

### Configure a system-wide proxy

To apply these settings to all users, modify the global /etc/wgetrc file. You will, however, need higher permissions to edit the configuration, and the changes will affect anyone running Wget on that device.

### Add proxy authentication to wgetrc

If your proxy requires credentials, you can add your proxy username and password directly to the configuration file for the proxy server. Because it stores your password in plain text, be sure to restrict read permissions on your .wgetrc file to prevent unauthorized access.

```typescript
use_proxy = on
http_proxy = http: / / HOST : PORT
proxy_user = YOUR_USERNAME
proxy_password = YOUR_PASSWORD
```

## Which Wget proxy method should you use?

| Method | Best for | Pros | Cons |
| --- | --- | --- | --- |
| Command-line flags | One-off downloads | Leaves no permanent configuration traces | Tedious for multiple downloads |
| Environment variables | Single terminal sessions | Affects multiple commands without altering system files | Settings disappear when the terminal closes |
| User .wgetrc | Persistent daily use | Automates Wget downloads for your user account | Stores passwords in plain text if authentication is used |
| System /etc/wgetrc | Server-wide setups | Applies proxy settings to all Wget users on the system | Requires administrative privileges to modify |

## How to check whether Wget is using the proxy

Check if your proxy server works by fetching a service that returns your public IP address using a standard Wget command. Run the command without a proxy to see your normal IP, then run it again with the proxy flags. The second output should display the proxy's IP.

```typescript
wget -qO- https: / /api.ipify.org
wget -qO- -e use_proxy=yes -e https_proxy=http: / / HOST : PORT https: / /api.ipify.org
```

## Bypass the proxy for specific hosts with no\_proxy

If you need to download files from a local server while a global proxy is active, use the no\_proxy variable. Set it to a comma-separated list of the domains or IP addresses you want to exclude.

```javascript
export no_proxy= "localhost,127.0.0.1,internal.local"
```

## Does Wget support SOCKS5 proxies?

Wget only supports HTTP, HTTPS, and FTP protocols natively. It cannot communicate directly with SOCKS5 proxies. To route traffic through a SOCKS tunnel, you must use a third-party tool.

### Use Wget with Proxychains

Proxychains intercepts network calls at the system level and routes them through your configured proxy. Just prefix your standard Wget command with proxychains.

```javascript
proxychains wget https: / / httpbin.org /
```

### When another tool may be easier

If you need native SOCKS5 support or complex authentication, consider switching tools. Read our [cURL vs Wget guide](https://marsproxies.com/blog/curl-vs-wget/) to see how cURL handles advanced connections natively without external wrappers.

## Common Wget proxy errors and fixes

### 407 Proxy Authentication Required

It means the proxy requires valid credentials, so you may have accidentally misspelled or added the wrong credentials. Check your username and password, and ensure you are passing them in the exact format your provider expects.

### Connection refused

It typically means the proxy server is offline, a firewall is blocking the connection, or you specified the wrong host or port. To fix it, verify the proxy server's IP address and port number, then confirm the proxy server is reachable from your network.

### Wget is ignoring the proxy

If Wget connects directly to the target, you might be using the http\_proxy variable for an HTTPS URL. Make sure you use https\_proxy for secure connections. Additionally, check that the target domain is not accidentally listed in your no\_proxy environment variable.

### HTTPS certificate errors

If your proxy performs SSL inspection, it will present a certificate that Wget does not recognize natively. You can append the --no-check-certificate flag to bypass this security check, but be aware that this exposes you to potential man-in-the-middle attacks.

### Proxy connection times out

It usually means the proxy is unreachable or your network connection dropped. While you can try pinging the proxy IP to check if it’s online, be aware that many servers block ping requests. If the proxy is definitely online, the target website might be blocking the proxy network entirely.

## Wget Proxy command cheat sheet

**One-off HTTP proxy:**

```typescript
wget -e use_proxy=yes -e http_proxy=http: / / HOST : PORT https: / / httpbin.org /
```

**HTTPS proxy:**

```typescript
wget -e use_proxy=yes -e https_proxy=http: / / HOST : PORT https: / / httpbin.org /
```

**Authenticated proxy:**

```typescript
wget -e use_proxy=yes -e http_proxy=http: / / HOST : PORT --proxy-user= USER --proxy-password= PASS https: / / httpbin.org /
```

**Environment variables:**

```typescript
export http_proxy= "http://HOST:PORT"
export https_proxy= "http://HOST:PORT"
```

**Wgetrc:**

```typescript
use_proxy = on
http_proxy = http: / / HOST : PORT
https_proxy = http: / / HOST : PORT
```

**No\_proxy:**

```javascript
export no_proxy= "localhost,127.0.0.1"
```

## Final thoughts

Configuring a Wget proxy server allows you to hide your local IP address and route traffic through custom gateways. While Wget has some limitations with native SOCKS5 support, environment variables and configuration files give you plenty of flexibility for different network setups.

If you need a reliable proxy service to use with your terminal workflows, providers like [MarsProxies](https://marsproxies.com/) offer compatible gateways.

## Frequently asked questions

How do I use a proxy with Wget?

Append the -e use\_proxy=yes and -e http\_proxy=http\://HOST:PORT flags to your command to route a download through the proxy.

How do I use a username and password with a Wget proxy?

Pass the --proxy-user=USERNAME and --proxy-password=PASSWORD flags directly in your command, or add them to your .wgetrc configuration file.

Should I use http\_proxy or https\_proxy with Wget?

Use http\_proxy for standard unsecured HTTP traffic, and use https\_proxy for encrypted HTTPS connections.

How do I disable a proxy in Wget?

Use the --no-proxy flag on a specific download to bypass any active proxy configuration and connect directly to the target server.

Why is Wget not using my proxy?

This usually happens due to a configuration conflict. Your wgetrc file settings silently override environment variables, and command-line flags override both. Also check that the use\_proxy = on directive is present in your wgetrc file.

[Learn more](https://dashboard.marsproxies.com/register/)

\-

Author

[Dalius Pamedytis Software Engineer](https://marsproxies.com/blog/authors/dalius-pamedytis/)

Table of contents

1. [Method 1: use a proxy for one Wget command](https://marsproxies.com/blog/wget-proxy/#b-method-1-use-a-proxy-for-one-wget-command)
2. [Use an HTTP proxy](https://marsproxies.com/blog/wget-proxy/#b-use-an-http-proxy)
3. [Use a proxy for HTTPS requests](https://marsproxies.com/blog/wget-proxy/#b-use-a-proxy-for-https-requests)
4. [Use an authenticated proxy](https://marsproxies.com/blog/wget-proxy/#b-use-an-authenticated-proxy)
5. [Method 2: set Wget proxy environment variables](https://marsproxies.com/blog/wget-proxy/#b-method-2-set-wget-proxy-environment-variables)
6. [Linux and macOS](https://marsproxies.com/blog/wget-proxy/#b-linux-and-macos)
7. [Make proxy variables persistent](https://marsproxies.com/blog/wget-proxy/#b-make-proxy-variables-persistent)
8. [Windows PowerShell](https://marsproxies.com/blog/wget-proxy/#b-windows-powershell)
9. [Method 3: configure a proxy in wgetrc](https://marsproxies.com/blog/wget-proxy/#b-method-3-configure-a-proxy-in-wgetrc)
10. [Configure a proxy for the current user](https://marsproxies.com/blog/wget-proxy/#b-configure-a-proxy-for-the-current-user)
11. [Configure a system-wide proxy](https://marsproxies.com/blog/wget-proxy/#b-configure-a-system-wide-proxy)
12. [Add proxy authentication to wgetrc](https://marsproxies.com/blog/wget-proxy/#b-add-proxy-authentication-to-wgetrc)
13. [Which Wget proxy method should you use?](https://marsproxies.com/blog/wget-proxy/#b-which-wget-proxy-method-should-you-use)
14. [How to check whether Wget is using the proxy](https://marsproxies.com/blog/wget-proxy/#b-how-to-check-whether-wget-is-using-the-proxy)
15. [Bypass the proxy for specific hosts with no\_proxy](https://marsproxies.com/blog/wget-proxy/#b-bypass-the-proxy-for-specific-hosts-with-noproxy)
16. [Does Wget support SOCKS5 proxies?](https://marsproxies.com/blog/wget-proxy/#b-does-wget-support-socks5-proxies)
17. [Use Wget with Proxychains](https://marsproxies.com/blog/wget-proxy/#b-use-wget-with-proxychains)
18. [When another tool may be easier](https://marsproxies.com/blog/wget-proxy/#b-when-another-tool-may-be-easier)
19. [Common Wget proxy errors and fixes](https://marsproxies.com/blog/wget-proxy/#b-common-wget-proxy-errors-and-fixes)
20. [407 Proxy Authentication Required](https://marsproxies.com/blog/wget-proxy/#b-407-proxy-authentication-required)
21. [Connection refused](https://marsproxies.com/blog/wget-proxy/#b-connection-refused)
22. [Wget is ignoring the proxy](https://marsproxies.com/blog/wget-proxy/#b-wget-is-ignoring-the-proxy)
23. [HTTPS certificate errors](https://marsproxies.com/blog/wget-proxy/#b-https-certificate-errors)
24. [Proxy connection times out](https://marsproxies.com/blog/wget-proxy/#b-proxy-connection-times-out)
25. [Wget Proxy command cheat sheet](https://marsproxies.com/blog/wget-proxy/#b-wget-proxy-command-cheat-sheet)
26. [Final thoughts](https://marsproxies.com/blog/wget-proxy/#b-final-thoughts)
27. [Frequently asked questions](https://marsproxies.com/blog/wget-proxy/#b-frequently-asked-questions)

Categories

- [Antidetect solutions](https://marsproxies.com/blog/category/antidetect-solution/)

  [3](https://marsproxies.com/blog/category/antidetect-solution/)
- [Comparisons](https://marsproxies.com/blog/category/comparisons/)

  [3](https://marsproxies.com/blog/category/comparisons/)
- [How to](https://marsproxies.com/blog/category/how-to/)

  [120](https://marsproxies.com/blog/category/how-to/)
- [Insights](https://marsproxies.com/blog/category/insights/)

  [86](https://marsproxies.com/blog/category/insights/)
- [Product news](https://marsproxies.com/blog/category/product-news/)

  [5](https://marsproxies.com/blog/category/product-news/)
- [Sneaker Bots](https://marsproxies.com/blog/category/sneaker-bots/)

  [2](https://marsproxies.com/blog/category/sneaker-bots/)

## Related articles

[How to](https://marsproxies.com/blog/category/how-to/)

### [How to Set Up a Proxy Server on PS5 (Step-by-Step Guide)](https://marsproxies.com/blog/proxy-server-on-ps5/)

Learn how to set up a proxy server on your PS5. Follow our easy guide to configure proxy settings, speed up downloads, and bypass blocks.

[Lukas Tilkevicius Growth & Partnerships Manager](https://marsproxies.com/blog/authors/lukas-tilkevicius/)

October 7, 2026

[How to](https://marsproxies.com/blog/category/how-to/)

### [How to Use Node Unblocker for Web Scraping & Privacy](https://marsproxies.com/blog/node-unblocker/)

Learn how to use Node Unblocker for web scraping, privacy, and bypassing restrictions. Follow setup steps, use cases, benefits, and key limitations.

[Dalius Pamedytis Software Engineer](https://marsproxies.com/blog/authors/dalius-pamedytis/)

October 6, 2026

[How to](https://marsproxies.com/blog/category/how-to/)

### [How to Fix Error: Externally-Managed-Environment in Python](https://marsproxies.com/blog/externally-managed-environment/)

Fix the externally-managed-environment error in Python. See why pip blocks system Python installs and how a virtual environment solves it.

[Lukas Tilkevicius Growth & Partnerships Manager](https://marsproxies.com/blog/authors/lukas-tilkevicius/)

October 5, 2026
