Guide to proxy the package managers

Complete guide to popular proxy and make requests

proxy with bower

Even though bower installs all the components mentioned in packages.json they uses bowerrc file for their internal configurations. By setting up proxy with bower you need to create a file called .bowerrc and update the proxies.

{
"directory": "bower_components",
"registry": "http://bower.herokuapp.com",
"proxy": "http://username:password@proxy_address:port",
"https-proxy":"http://username:password@proxy_address:port"
}

Note: please see the http in https-proxy

Proxy with npm

Node configuration are done by npm config manager.

npm config set proxy http://proxy.company.com:port
npm config set https-proxy http://proxy.company.com:port

Note: please note the http in https-proxy

Proxy with Apt-get

When you encounter a proxy problem with apt-get, Please make sure check the 01proxy file

vi /etc/apt/apt.conf.d/01proxy
Acquire::http::Proxy "http://username:pswd@proxy_address:port";
Acquire::https::Proxy "https://username:pswd@proxy_address:port";
Acquire::ftp:Proxy "ftp://username:pswd@proxy_address:port";

Proxy with Python

Well popular package manager in this space called pypi uses system proxy settings

export http_proxy=http://username:password@proxy_address:port
export https_proxy=https://username:password@proxy_address:port
export ftp_proxy=ftp://username:password@proxy_address:port

Note: In requests library there is an option called `proxies` that will take care of proxy when making requests.

Show your support

Clapping shows how much you appreciated Raja Simon’s story.