/how-to-configure-proxy

Free yourself from endless Google search on proxy configuration for dev tools.

Creative Commons Zero v1.0 UniversalCC0-1.0

How to configure proxy

The goal of this repo is to free yourself from endless search on Google for guides and docs that tell you how to configure proxy for dev tools like github, npm and so on.

PRs and issues are welcomed.

My environment

App clash opens port 7890 for http and socks proxy. This may be a common proxy env in mainland China.

git

Basic form. Just globally configured once.

git config --global http.proxy http://<proxy.server>:<port> # without username and password
git config --global http.proxy http://<proxy_username:proxy_password>@<proxy.server>:<port> # with username and password

If you are using Clash.

git config --global http.proxy http://127.0.0.1:7890

npm

npm --proxy http://<proxy_username:proxy_password>@<proxy.server>:<port> i <name_of_package>

If you are using Clash.

npm --proxy http://127.0.0.1:7890 i -g yarn