设置:python
$ git config --global http.proxy http://proxy.mysite.com
取消:git
$ git config --global --unset http.proxy
设置代理:npm
$ npm config set proxy=http://proxy.mysite.com
取消代理:windows
$ npm config delete proxy
设置镜像:sass
$ npm config set registry https://registry.npm.taobao.org
或者安装的时候指定:ruby
$ npm install --registry https://registry.npm.taobao.org XXX
或者能够使用nrm
这个模块来切换镜像代理
// 安装nrmcode
$ npm install -g nrm
// 查看镜像ip
$ nrm ls
// 对比镜像速度bower
$ nrm test
// 使用淘宝镜像
$ nrm use taboo
还能够在~/.npmrc加入下面内容
registry = https://registry.npm.taobao.org
取消镜像:
$ npm config delete registry
或者删掉对应内容
设置:
修改.bowerrc文件
{ "proxy": "http://proxy.mysite.com", "https-proxy": "http://proxy.mysite.com" }
取消:
删除对应配置。
设置镜像:
$ pip install -i http://pypi.douban.com/simple Django
或者能够修改配置文件,Linux/Unix/MacOS 在 $HOME/.pip/pip.conf
,windows在C:\Users\Administrator\pip\pip.ini
:
[global] find-links = http://pypi.douban.com http://e.pypi.python.org
全部命令都会现检索豆瓣镜像,后检索清华镜像,每一个镜像要占一行。
也能够指定专门某个命令,好比pip installl才用镜像:
[install] find-links = http://pypi.douban.com http://e.pypi.python.org
设置镜像:
$ gem sources -a http://ruby.taobao.org/
取消镜像:
$ gem sources -r http://ruby.taobao.org/
使用代理:
安装时加上--http-proxy
参数
$ gem install --http-proxy http://ruby.taobao.org/ sass
还能够到RubyGems去把包下载到本地,而后用gem安装
$ gem install --local sass.gem
但最有效的方法仍是不要去修改sources ,由于若是使用rails 每次项目建立时rails仍是会默认使用 https://rubygem.org 做为下载源,咱们只要将一切发送至 https://rubygem.org的请求镜像至https://ruby.taobao.orgy 就好了。
bundle config mirror.https://rubygems.org https://ruby.taobao.org