git,npm,bower设置代理地址

我們先假設代理伺服器的位址為:

  • http://10.0.0.1:8080

設定 Git 使用代理伺服器

輸入兩行指令即可設定完畢:

  • git config --global https.proxy http://10.0.0.1:8080
  • git config --global http.proxy http://10.0.0.1:8080
  • git config --global http.sslVerify false

取消設定 Proxy 的方法:

  • git config --global --unset http.proxy
  • git config --global --unset https.proxy
  • git config --global --unset http.sslVerify

參考資料

設定 npm 使用代理伺服器

輸入兩行指令即可設定完畢:

  • npm config set https-proxy http://10.0.0.1:8080
  • npm config set proxy http://10.0.0.1:8080
  • npm config set strict-ssl false

取消設定 Proxy 的方法:

  • npm config delete https-proxy
  • npm config delete proxy
  • npm config delete strict-ssl

參考資料

設定 Bower 使用代理伺服器

請建立一個 %UserProfile%.bowerrc 檔案 ( 若為 Mac OS X 請建立 ~/.bowerrc 檔案 ),其內容如下:

{
 "registry":"http://10.0.0.1:8080"
"proxy": "http://10.0.0.1:8080",
"https-proxy": "http://10.0.0.1:8080", "strict-ssl": false }

取消設定 Proxy 只要將 %UserProfile%.bowerrc 檔案刪除即可。

原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/7725192.html