Setting Proxy Environment variable

Setting Proxy Environment variable

Sometimes the application you work looks for environment variable for your proxy setting. This is required if you are working on corporate network where proxy is enabled. You need to set up two variable HTTP_PROXY and HTTPS_PROXY when you are making call out to the internet.

Many third party API uses environmental variables of HTTP_PROXY and HTTPS_PROXY when they need to call out to the internet.

You can set this value either in environment OR each session in command line:

HTTP_PROXY=http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT
HTTPS_PROXY=http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT

  • To set these value to system environment on windows go to Control panel –> System –> Advance system settings –> Environment Variables –> New –> Enter variable name and variable value then click OK:

Setting Proxy Environment variable

  • Follow same procedure and set HTTPS_PROXY value.

If you want to set this value in each session through Windows command line, please set value as below:

set HTTP_PROXY=http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT
set HTTPS_PROXY=http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT

  • If you are using git bash shell on windows then create “.bashrc” file in root of your user profile (C:\Users\UserName OR in windows XP : C:\Documents and Settings\USERNAME) add below:

export HTTPS_PROXY=http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT

Leave a Reply

Your email address will not be published. Required fields are marked *