How to wget via proxy

This is how I use wget via proxy. It goes like this. You set http_proxy to refer to your proxy setting and from there you just issue wget command.

[user@localhost ~]$ export http_proxy=http://username:password@proxyaddress:proxyport/
[user@localhost ~]$ wget [someoption] [download_link]

Note: if your proxy doesn’t require authentication, just omit the username & password part in http_proxy. Like this..

[user@localhost ~]$ export http_proxy=//proxyaddress:proxyport

For some reasons unknown to me, the above method no longer working (at least in my case). I got this error

Error parsing proxy URL http://username:password@proxyaddress:proxyport/: Bad port number.

It seems that my username or password can’t be parsed. My solution is just set the http_proxy without username & password and then enter my username and password through wget option. And it works(Yay!).

[ferry@lenovog480 ~]$ http_proxy=http://proxyaddress:proxyport/
[ferry@lenovog480 ~]$ wget --proxy-user=myusername --proxy-password=mypassword [someoption] [download_link]

Advertisements

Tags: ,

About Ferry T.H.

I'm just your fellow human being.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: