Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to know an equivalent to wget enabling me to set the proxy while calling the command (like wget --proxy=$http_proxy).

Any ideas ?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Without modifying your system files at /etc/wgetrc you could create a file at your home directory ~/.wgetrc. It will enable you to modify wget settings locally at user level. Now write the following at ~/.wgetrc to use wget behind a proxy server:

use_proxy = on
http_proxy =  http://username:password@proxy.server.address:port/
https_proxy =  http://username:password@proxy.server.address:port/
ftp_proxy =  http://username:password@proxy.server.address:port/

If you do not have proxy username and password just write the proxy-address and port everywhere like,

http_proxy =  http://proxy.server.address:port/

This should work. I am assuming you already have proxy settings for all other applications.

share|improve this answer

You need to edit the wgetrc file located at /etc/wgetrc.

Use your favourite text editor, ie: nano /etc/wgetrc to edit it

Look for the http_proxy tag and remove the # in front of it, add the proxy server after the = sign, ie:

http_proxy=http://foo.proxy:8080

Then search for the use_proxy tag and remove the # in front of it, save the file.

wget will be then using the specified proxy server.

If you can't change system configuration with your user you can copy the current configuration to a place you can edit it, ie: cp /etc/wgetrc ~ and use the --config=~/wgetrc option to force wget to use the configuration you altered instead of the global configuration.

share|improve this answer
    
I'm aware of this possibility, but I can't modify config files. –  fxm Sep 17 '13 at 14:49
    
Think this is the only option you have with wget. –  Bruno Pereira Sep 17 '13 at 16:31
    
That's why I'm looking for an equivalent of wget as I indicated in the title. –  fxm Sep 18 '13 at 6:58
    
I have edited the title to reflect that, it was clear on the first place what you were trying to do. –  Bruno Pereira Sep 18 '13 at 8:57
    
Check the last paragraph of the answer. –  Bruno Pereira Sep 18 '13 at 9:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.