How To Use Wget With Proxy? [For Mac, Windows, & Linux]

Reading time: 6 min read
Harsha Kiran
Written by
Harsha Kiran

Updated · Nov 17, 2023

Harsha Kiran
Founder | Joined March 2023 | LinkedIn
Harsha Kiran

Harsha Kiran is the founder and innovator of Techjury.net. He started it as a personal passion proje... | See full bio

Girlie Defensor
Edited by
Girlie Defensor

Editor

Girlie Defensor
Joined June 2023
Girlie Defensor

Girlie is an accomplished writer with an interest in technology and literature. With years of experi... | See full bio

Techjury is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission. Learn more.

The global average internet speed of 110 Mbps may look amazing, but 64.70 Mbps average download speed might not help with big downloads. 

With files getting larger, the demand for tools that can aid  users in downloading larger files with slower connection speeds increased. Wget is one such tool

WGet is a non-interactive mechanism that lets you download files. it also lets you download safely—with the help of proxy servers

In this article, you will learn how to use a Wget command with proxy IPs. Read on to find out.

Key Takeaways

  • Wget is a powerful command-line tool for downloading files. It is compatible with Mac, Windows, and Linux.
  • Proxies enhance security and anonymity with Wget, enabling bypassing IP blocks and geo-restrictions.
  • Install Wget on your device by following the provided instructions for Mac, Windows, and Linux.
  • Familiarize yourself with basic Wget commands for downloading files, multiple URLs, entire websites, and saving to specific directories.

Using Wget With Proxies

As open-source GNU software, Wget lets users download files on the web even with minimal or controlled bandwidth. 

It is commonly pre-installed on Linux, but it is also compatible with MacOS and Windows.

The Wget command functions can be used in scripts, terminals, and cron jobs. 

It can also let you perform recursive downloads and full mirroring of websites by storing the HTML file for local access.

Wget commands have a simple syntax that goes like this:

Wget [options] [URL]

The options are the specific Wget command functions. If Wget is installed, you can check the list of options by typing Wget -h.

Wget is often used for downloading large files. It is non-intrusive and can silently work in the background, even when a different user is logged in. 

It can also resume interrupted downloads. For added security and anonymity, you can use Wget with proxy IPs. It can also be used for testing proxies.

What You Need

First, you have to check if Wget is installed on your device. Open your terminal or command prompt and type in Wget -V

If Wget is installed, it should print the version and license information. However, if it is not present, you can install Wget by following these steps: 

A. Installing Wget on MacOS

You can install Wget through the Homebrew packet manager. Type in this command:

brew install Wget

Run the Wget -V command again to check if it’s successfully installed.

B. Wget Installation on Windows

Here is the easiest way to install Wget in Windows:

  1. Download the Wget.exe file for your desired version.
  2. Open your file manager and search for the directory: Windows\System32.
  3. Copy and paste the Wget.exe file into the System32 folder.
  4. Run Wget -V in your command prompt to check if it was installed successfully.

C. Installing Wget on Linux

Wget should be pre-installed on Linux. In case it’s not present, you can install Wget with these commands:

For Ubuntu:

sudo apt-get install Wget

For CentOS:

sudo yum install Wget

Getting Your Proxies

After ensuring Wget is installed, you should also have your proxies ready. You can get proxy IPs from paid and free sources.

Keep in mind that it is generally safer to use a paid proxy service. Free proxies are unsafe and often abused by many users.

Helpful Article: Getting the proxy that suits your needs is important to enjoy a safe browsing experience. Check out the leading proxy server services that you can choose from.

Steps To Use Wget With A Proxy

Before we get into the use of proxies, let’s take a look at the basic Wget commands that you can perform. 

1. Know the Basic Wget Commands

For MacOS and Linux, you can use the built-in terminal to run Wget commands.

In the case of Windows users, you can choose between the Windows command prompt or Powershell. 

It is a more advanced command-line software built by Microsoft that is also a programming language on its own. 

To download a file, simply run this command:

Wget https://www.example.com/example.pdf

To download files from multiple URLs, create a .txt file containing the download links.  Then, run

Wget -i manydownloads.txt

If you want to download the whole website in HTML, use this command:

Wget -m https://www.example.com/

To save a downloaded file to a specific directory, you can use:

Wget -P \Documents\Examples https://www.example.com/example.pdf

To view all “options,” you can run:

Wget -h

These commands will be useful when using proxies in Wget, so make sure to take note of each one. 

2. Applying Proxies To Wget Commands

Wget primarily supports HTTP, HTTPS, and FTP protocols. 

If you require SOCKS proxies, you can use a Wget alternative like cURL. It can support a lot of protocols.

To apply a proxy to your download request, use the execute (-e) option to activate proxy use and apply the actual proxy.

Here’s an example:

Wget -e use_proxy=yes -e http_proxy=[proxy IP]:[port] https://example.com/examplefile.zip

For proxies that need authentication, you can use Wget with your proxy username and password. It should look like this:

Wget -e use_proxy=yes -e https_proxy=[proxy IP:port] --proxy-user=[username] --proxy-password=[password] https://example.com/example.pdf

 Another option is to configure the proxy in the operating system. This will make all connections go through the proxy server. 

With this, you will not have to type in the long proxy command all the time.

Below are steps on how you can do that across different operating systems. 

Setting up a Proxy on Windows

To set up a proxy on Windows:

  1. Click on the Windows icon.
  2. Click on Settings (or the gear icon).
  3. Select Network and Internet.
  4. Select Proxy.
  5. Click on Set up under the Manual proxy set up.
  6. Toggle on Use a proxy server and input the proxy IP and port number.
  7. Click Save.

etting Up Proxy Server on Windows

Building a Proxy on MacOS

Here’s how to set up a proxy on MacOS:

1. Click on the Apple logo in the top-right corner.

2. Select System Preferences.

3. Click on Network.

4. Select your active network connection. It’s either Ethernet or WiFi.

5. Click on Advanced.

Proxy Configuration on Mac

6. Select the protocol type of your proxy or the automatic proxy options.

7. Enter the proxy IP and port number.

8. If the proxy requires authentication, tick the checkbox beside Proxy server requires authentication. Enter the username and password.

9. Click OK.

Putting Up a Proxy on Linux

For Linux, there is a way to configure the proxy settings on Wget without affecting the OS. All you have to do is configure the Wgetrc file.

1. Type in this command to access the Wgetrc file.

sudo nano /etc/wgetrc

2. It should return your Wget configurations. Find these lines.

#https_proxy = http://proxy.yoyodyne.com:18023/

#http_proxy = http://proxy.yoyodyne.com:18023/

#ftp_proxy = http://proxy.yoyodyne.com:18023/

3. Remove the comment symbol (number sign) of the proxy protocol that you want to configure. It should look like this:

#https_proxy = http://proxy.yoyodyne.com:18023/

http_proxy = http://proxy.yoyodyne.com:18023/

#ftp_proxy = http://proxy.yoyodyne.com:18023/

4. Change it to your proxy IP and port number.

http_proxy = http://[proxy IP]:[port]/

5. Exit and save the changes.

Now, you can send all your Wget download requests through a proxy.

Conclusion

Wget is a highly useful tool for downloading large files and mirroring websites, even with a limited internet connection speed. 

It is even more useful with the use of proxies, which let you bypass IP blocks and geo-restrictions while staying anonymous.

The best thing about Wget is that it is open-source. You can use it absolutely free of charge. It is also continuously being updated, so it will just keep getting better.

FAQs.


What is the config file for Wget?

The config file for Wget is Wgetrc. In Linux, you can access this file using the command sudo nano /etc/Wgetrc.

What does proxy URL mean?

The proxy URL is the actual address that will redirect your connection to the proxy server. Here’s an example of a proxy URL: https://123.456.789.123:8080.

SHARE:

Facebook LinkedIn Twitter
Leave your comment

Your email address will not be published.