hakopako

Full-stack Engineer's blog

Proxy command options and setting file notations - yum/rpm/curl/wget/git/gem/pip/npm -

日本語 | English

If proxy is barproxy:1234.

yum

$ vim /etc/yum.conf
proxy=http://barproxy:1234     # add

rpm

$ rpm --httpproxy barproxy --httpport 1234 http://aaa.com

curl

# --- command --------
$ curl http://aaa.com --proxy barproxy:1234
$ curl -x barproxy:1234 http://aaa.com

# --- configure file ----
$ vim ~./curlrc
proxy="http://barproxy:1234"    # add

wget

# --- command --------
$ wget "http://aaa.com" -e use_proxy=yes -e http_proxy=barproxy:1234
$ wget "https://aaa.com" -e use_proxy=yes -e https_proxy=barproxy:1234

# --- configure file ----
$ vim ~/.wgetrc
http_proxy=http://barproxy:1234    # add
https_proxy=http://barproxy:1234     # add

git

$ git config --global http.proxy http://barproxy:1234
$ git config --global https.proxy http://barproxy:1234

or edit .gitconfig file.

gem

$ gem install aaa --http-proxy http://barproxy:1234
$ gem install aaa -p http://barproxy:1234

rbenv

set wget and curl proxies.

pip

$ pip install aaa --proxy=barproxy:1234

npm

# --- command --------
$ npm --proxy http://barproxy:1234 install aaa
$ npm --https-proxy http://barproxy:1234 install aaa

# --- configure file ----
$ ~/.npmrc
proxy = http://barproxy:1234    # add
https-proxy = http://barproxy:1234    # add