Thursday 1 December 2011

wget: proxy setting and wgetrc file

If your internet connection is set to use proxy network then you have to specify the same to wget as well.
otherwise wget will throw "connection refused.." error.

To specify http proxy address to wget you can do either of them.

->By providing in the command line argument
wget  "http_proxy=host:port" url
 -> By providing http proxy address in the wgetrc file so that everytime you run wget it automaticallly set http proxy address by reading it from wgetrc file.
You'll find wgetrc file in window environment under your "etc" folder.For example mine wget's wgetrc file path is this:         
                          C:\Program Files (x86)\GnuWin32\etc

Open the file and find " http_proxy"
                          #http_proxy = http://proxy.yoyodyne.com:8080/
change it to
                            http_proxy = 172.28.1.253:8080/

Apart from proxy address you can also provide many other option to wget on this wgetrc file You can use this file to change the default behaviour of wget or to avoid having to type many many command-line options

Now save it and fire up the new command prompt.
Now, you'll see you wget up and running and using proxy address specified in wgetrc file.

1 comment:

  1. Thanks man :) .. that worked for me ..

    ReplyDelete