It is not rare for a developer having to work behind corporate’s proxy. Following are the list of steps that I end up going through in getting development environment ready. I’ll update the list as going forward.
PowerShell
netsh winhttp import proxy source=ie
or
netsh winhttp set proxy "{your.proxy.address}:{your.proxy.port}"
Refer this for full detail
Azure PowerShell
$proxyString = "http://127.0.0.1:8888" $proxyUri = new-object System.Uri($proxyString) [System.Net.WebRequest]::DefaultWebProxy = new-object System.Net.WebProxy ($proxyUri, $true) [System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials Login-AzureRmAccount Get-AzureRmSubscription
Refer to this for full detail
Visual Studio
<defaultProxy enabled="true" useDefaultCredentials="true"> <proxy bypassonlocal="True" proxyaddress="http://<yourproxy:port>"/> </defaultProxy>
Refer this for full detail.
Bash on Windows 10
Configure .bashrc with this
Git bash
global configuration
To globally configure,
git config --global http.proxy http://{yourdomain}\{yourusername}:{yourpassword}@{your.proxy.address}:{your.proxy.port}
This generates .gitconfig
file within your home directory
Check with the following command on PowerShell
cat ~\.gitconfig
CAUTION with global configuration for git
Visual Studio does its authentication to proxy server in its own way and doesn’t understand http.proxy config as expected. Instead, it will just read entire http.proxy value as a proxy server address and try login with popup. This ends up failure even if you put your credential again.
So, use global configuration when you need to clone git repository from somewhere but make sure to remove the http.proxy config back from the file to make it work with Visual Studio.
local configuration
To locally configure,
git config --local http.proxy http://{yourdomain}\{yourusername}:{yourpassword}@{your.proxy.address}:{your.proxy.port}
Anaconda
Create a .condarc
file under your home directory with following detail.
channels: - defaults proxy_servers: http: http://{your.proxy.address}:80 https: https://{your.proxy.address}:80 ssl_verify: true
Pip Install
from windows command prompt
,
SET HTTPS_PROXY=https://{yourdomain}\{yourusername}:{yourpassword}@{your.proxy.address}:{your.proxy.port}
SET HTTP_PROXY=http://{yourdomain}\{yourusername}:{yourpassword}@{your.proxy.address}:{your.proxy.port}