Tuesday, June 23, 2009

The http_proxy Environment Variable

If you use a proxy server or firewall, you may need to set the http_proxy environment variable in order to access some url from commandline.
Example : Installing ppm for perl or applying rpm in linux ,updating ubuntu

Set the http_proxy variable with the hostname or IP address of the proxy server:
If the proxy server requires a user name and password, include them in the following form:
If the proxy server uses a port other than 80, include the port number:

Windows XP
  1. Open the Control Panel and click the System icon.
    The System Properties dialog is displayed.
  2. On the Advanced tab, click on Environment Variables.
    The Environment Variables dialog is displayed.
  3. Click New in the System variables panel.
    The New Sytem Variable dialog is displayed.
  4. Add http_proxy with the appropriate proxy information (see examples above).

Linux, Solaris or HP-UX
Set the http_proxy environment variable using the command specific to your shell (e.g. set or export). To make this change persistent, add the command to the appropriate profile file for the shell. For example, in bash, add a line like the following to your .bash_profile or .bashrc file:
   export http_proxy


  1. export http_proxy=http://username:password@

    is this a correct statement??

  2. try http_proxy=http://%username%:%password%@

  3. what does one do if the '@' character is in the password, Arrrg

    1. substituting %40 for the @ worked for me

  4. This is not correct:

    export $http_proxy

    The correct one should be without $ because you want to export the variable no its content.

    export http_proxy

  5. This creates issue when you use utl_http package in oracle db. I'm haven't tested it with username and password set at proxy env variable.
    Just to inform everyone.

    Sundar K

  6. If you wanna access blocked site then check this short method to access without any long methods.
    Mousebreaker UK proxy

  7. Great to know about but I can open in seconds just one click and you can open any blocked site just a click on this.
    Mp3skull UK proxy

  8. is there a socks and ftp proxy variable for windows too ?

  9. Your nice work is very attractive and impressive.
    Mp3skull UK proxy

  10. How to determine URL for proxy server for personal laptop?

  11. Your blog give many information thanks for share this informative article.
    DownloadForAll UK proxy

  12. Wow i can say that this is another great article as expected of this blog.Bookmarked this site..
    ADG Consulting

  13. i done all the above steps but no one worked

  14. This comment has been removed by the author.