Chuck Conway

In The craft

Setting Proxies for Git, NPM, Bower and Webdriver

October 5, 2015 · 1 minute read

Companies often setup proxy servers to filter their traffic. The intention is to keep wayward employees from ‘accidentally’ visiting sites that do not align with the professional environment.

To access the internet everything must pass through the proxy. Applications like Git, NPM, Bower and Webdriver aren’t configured out of the box to use the company’s proxy. When installed, then simply don’t work.

Below are instructions for setting the proxy for Git, NPM, Bower, and Webdriver.

Bower

Create a .bowerrc file in your home (%USERPROFILE%) folder. Add these contents:

{
    "proxy":"http://example.proxy.com:80",
    "https-proxy":"http://example.proxy.com:80"
}

Git

git config --global http.proxy example.proxy.com:80
git config --global https.proxy example.proxy.com:80

set http_proxy=http://example.proxy.com:80
set https_proxy=http://example.proxy.com:80

NPM

npm config set proxy http://example.proxy.com:80
npm config set https-proxy http://example.proxy.com:80

npm config set registry http://registry.npmjs.org/

Webdriver

//doing an update
webdriver-manager update --proxy="example.proxy.com:80"