1 min read

Speed up your internet connection in China

As a developer, you love fast internet connection, right? But here in China lots international services are slow, here is what you can do to make your life easier:

Use Shadowsocks

Why? It's faster than VPN. It's recommended to install Shadowsocks server on your VPS. Refer to wiki to learn about how to set up the servers and clients.

SoftEther for VPN

Sometimes Shadowsocks doesn't work, for example, I found Firebase iOS SDK doesn't work behind Shadowsocks proxy. Since I only use VPN once in a while, I don't want to pay a monthly fee for a VPN service. After tried various ways, SoftEther works for me.

Git proxy

Set Shadowsocks proxy for Git to speed up your Git.

Execute the commands in:

git config --global https.proxy socks5://
git config --global https.proxy socks5://

Or add this in ~/.gitconfig:

	proxy = socks5://
	proxy = socks5://

You can also set environment variables to disable the proxy for some urls:

export no_proxy=.my.company,localhost,


Use ProxyChains-NG for command-line tools to use Shadowsocks proxy, such as curl, wget, git.

brew install proxychains-ng

Use mirrors servers for package managers

The default servers for various package managers are slow in China, you need to switch to domestic ones.


git config --global url."https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs".insteadOf "https://github.com/CocoaPods/Specs"


  1. https://mirror.tuna.tsinghua.edu.cn/help/CocoaPods/
  2. https://github.com/CocoaPods/CocoaPods/issues/4997#issuecomment-193757909


gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/



vi ~/.pip/pip.conf

 trusted-host = mirrors.aliyun.com
 index-url = http://mirrors.aliyun.com/pypi/simple


npm install -g cnpm --registry=https://registry.npm.taobao.org