Skip to content

Latest commit

 

History

History
121 lines (88 loc) · 2.55 KB

set-npm-git-ssh-proxy.md

File metadata and controls

121 lines (88 loc) · 2.55 KB

Ref.

Hint

  • http://USERNAME:PASSWORD@IP:PORT 可以改為 http://IP:PORT

Setting

NPM

npm config set http-proxy http://USERNAME:PASSWORD@IP:PORT
npm config set https-proxy http://USERNAME:PASSWORD@IP:PORT
npm set strict-ssl false

in C:\Users\USERNAME\.npmrc:

proxy=http://USERNAME:PASSWORD@IP:PORT
http-proxy=http://USERNAME:PASSWORD@IP:PORT
https-proxy=http://USERNAME:PASSWORD@IP:PORT
strict-ssl=false

GIT

git config --global http.proxy http://USERNAME:PASSWORD@IP:PORT
git config --global https.proxy http://USERNAME:PASSWORD@IP:PORT

in C:\Users\USERNAME\.gitconfig:

[http]
	proxy = http://USERNAME:PASSWORD@IP:PORT
[https]
	proxy = http://USERNAME:PASSWORD@IP:PORT

SSH

in C:\Users\USERNAME\.ssh\config:

ProxyCommand connect -H IP:PORT %h %p

Host github.com
  User git
  Port 22
  Hostname github.com
  IdentityFile "C:\users\USERNAME\.ssh\id_rsa"
  TCPKeepAlive yes
  IdentitiesOnly yes

Host ssh.github.com
  User git
  Port 443
  Hostname ssh.github.com
  IdentityFile "C:\users\USERNAME\.ssh\id_rsa"
  TCPKeepAlive yes
  IdentitiesOnly yes

Host bitbucket.org
  User git
  Port 22
  Hostname bitbucket.org
  IdentityFile "C:\users\USERNAME\.ssh\id_rsa"
  TCPKeepAlive yes
  IdentitiesOnly yes

VS CODE

in setting.json:

{
  "http.proxy": "http://USERNAME:PASSWORD@IP:PORT",
}

NVM

# set proxy
nvm proxy http://USERNAME:PASSWORD@IP:PORT

# show a list of versions available for download.
nvm list available

# install node
nvm install NODE_VERSION

# set use node version
nvm use NODE_VERSION