Friday, October 12, 2012

wget command syntax to access URL via Proxy

Folks, this is been a long time since I have posted here. Hmm ...lot of work :)

Use case :

Last week I faced a situation where I am not able to access an External URL ( meaning the setup is behind the Proxy ) via proxy from the java code.

However we were able to access the same URL using browser. It was real tricky that as we were not able to pinpoint the exact error which is causing the problem while accessing via JAVA code.

Finding the Error :

Used 'wget' tool, to access the URL which gave the exact error.  Given below the syntax of the same using Proxy .

Syntax :

wget -e http_proxy=http://<proxyhost>:<proxyport> --proxy-user=<proxyusername> --proxy-password=<proxypassword> <URLName>

Please note the argument '-e'  which is required if you need to specify the 'http_proxy' argument and this 'http_proxy' will not be available in the help page of wget.



Cheers !!
Krishna.

2 comments:

  1. I am very thankful to the author to write this fruitful information.It is worth sharing for other users.Thanks once again
    access Monova in UK

    ReplyDelete
  2. Thanks a lot for making this available. I really appreciate that.
    Fenopy UK proxy

    ReplyDelete