Skip to content

Instantly share code, notes, and snippets.

@iAladdin
Forked from beradrian/setproxy
Last active Jul 17, 2018
Embed
What would you like to do?
Set proxy for npm and git
# set a proxy
export HTTP_PROXY=
export HTTPS_PROXY=$HTTP_PROXY
npm config set proxy $HTTP_PROXY
npm config set https.proxy $HTTPS_PROXY
npm config set https-proxy $HTTPS_PROXY
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTPS_PROXY
# unset proxy
npm config delete proxy
npm config delete https.proxy
npm config delete https-proxy
git config --global --unset http.proxy
git config --global --unset https.proxy
@iAladdin
Copy link
Author

iAladdin commented Jul 17, 2018

export HTTP_PROXY=http://127.0.0.1:1087
export HTTPS_PROXY=$HTTP_PROXY
npm config set proxy $HTTP_PROXY
npm config set https.proxy $HTTPS_PROXY
npm config set https-proxy $HTTPS_PROXY
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTPS_PROXY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment