How To Use Wget Through Proxy

By Angsuman Chakraborty, Gaea News Network
Friday, August 25, 2006

Wget is a super-useful utility to download pages and automate all types of web related tasks. It works for HTTP as well as FTP URL’s. Here is a brief tutorial on how to use wget through proxy server.

To get wget to use a proxy, you must set up an environment variable before using wget. Type this at the command prompt / console:
For Windows:
set http_proxy=https://proxy.example.com:8080

For Linux/Unix:
export http_proxy="https://proxy.example.com:8080"

Replace proxy.example.com with your actual proxy server.
Replace 8080 with your actual proxy server port.

You can similarly use ftp_proxy to proxy ftp requests. An example on Linux would be:
export ftp_proxy="https://proxy.example.com:8080"

Then you should specify the following option in wget command line to turn the proxy behavior on:
–proxy=on

Alternatively you can use the following to turn it off:
–proxy=off

You can use –proxy-username="user name" –proxy-passwd="password" to set proxy user name and password where required.
Replace user name with your proxy server user name and password with your proxy server password. Another alternative is to specify them in http_proxy / ftp_proxy environment variable as follows:
export http_proxy="https://username:password@proxy.example.com:8080"

Filed under: Headline News, How To, Tech Note, Web

Tags:
Discussion
November 25, 2010: 11:30 am

can you make the export of http_proxy permanent?

November 25, 2010: 12:54 am

hyphenhyphens, and vomiting emdashes. ;)

October 9, 2010: 6:11 am

I have been reading your articles during my lunch break, and I have to admit the whole article has been very valuable and very well written. I thought I would let you know that for some reason this blog does not view well in Internet Explorer 8. I wish Microsoft would stop changing their software.

October 1, 2010: 1:44 am

as everyone know tiffany and co, Louis vuitton handbags are very hot on Christmas, people are buy Gucci handbags or Gucci shoes as a gift for their family, for me I will buy mbt shoes or nike shoes to my family in summer day.

September 26, 2010: 8:27 pm

the environment variables aren’t the only way to communicate this information to wget.


Nike Air Max 95
September 15, 2010: 12:31 am

I think your opinions are reasonable.But I don’t agree with you to some extent.

August 23, 2010: 10:43 pm

.Hey, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using Wordpress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?


nike shox
August 20, 2010: 2:49 am

I will bookmark your blog and have my kids check up here frequently. I’m very certain they will understand lots of new stuff here than anybody else. I do appreciate that youve added relevant and intelligent commentary here though. Thank you!

August 6, 2010: 6:00 pm

I found your entry interesting so I’ve added a Trackback to it on our website.

July 30, 2010: 9:03 am

Bookmarked your website. Thank you for sharing. Definitely worth the time away from my classwork.

June 21, 2010: 10:37 pm

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info

June 4, 2010: 3:30 am

lol ! very good ! thank you !

June 3, 2010: 2:11 am

thank you ,very good

June 3, 2010: 2:03 am

You can put it on your side of the reinforced concrete or shell, But in fact, the environment variable is not the only way to convey information package.

June 2, 2010: 11:46 pm

Thank you, you have been most helpful.

June 2, 2010: 10:29 pm

thank you for your sharing

June 2, 2010: 10:28 pm

thank you for your sharing.


gebrax
January 8, 2010: 4:41 am

may i ask u some question??
i must connect to proxy if i was in college, but when im in home, i must using automatic proxy conf.so how to change last configuration which is using proxy to new setting>>that automatic proxy in wget?thanks

email me pliss sir

December 18, 2009: 7:41 pm

one day i went shopping outside,and in an ed hardy store,I found some kinds of ed hardy i love most they are Your website is really good Thank you for the information


arun
December 11, 2009: 3:27 am

it really worked for using cmd line for remote hosts. Really awsome. worked exactly as it is described.


Larry Jones
November 18, 2009: 2:27 pm

Hello,

Is there a way to have wget work when you have to use a configuration script? That is, I have to enable the “use atomatic configuration script” option under Tools/Internet Options/Connections Tab/LAN Settings

thanks,

Larry

September 29, 2009: 8:33 pm

thx, i know now!


Pawan
August 11, 2009: 12:33 pm

Hi,

Thanks for the article .. it helped me to solve one problem.. really thanks

regards,
pawan

October 26, 2008: 7:26 am

@ Benson: Well, endashes, but same diff.

@ koen: You could place it in your shell’s rc or profile; but actually, the environment variables aren’t the only way to communicate this information to wget. They are also available as wgetrc commands, so you can place them in your ~/.wgetrc; you can also specify them on the command-line as: -e http_proxy=… -e proxy_password=…


koen
October 2, 2008: 1:48 am

how can you make the export of http_proxy permanent?


Benson
September 9, 2008: 6:44 pm

Your content system is eating your hyphenhyphens, and vomiting emdashes. ;)

August 26, 2008: 2:16 am

[...] here. If you’re behind a firewall, there’s some hints here on how to get Curl/Wget to play nicely with firewalls (even though the instructions are for wget, it still applies to curl). Once you think you’ve [...]


sam
January 17, 2008: 10:47 am

Correct usage is:
–proxy-user=\\\\\\\”user name\\\\\\\” –proxy-password=\\\\\\\”password\\\\\\\”

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :