As the Great Firewall's blocking became stricter and its traffic filtering more precise, the Shadowsocks (SS) setup I'd used reliably for a long time stopped working, so I had to find another solution. After some searching, I found V2Ray, which uses the VMess protocol, and decided to try it. The official user manual is very detailed, and if you follow the steps, setup is easy. I ran into a few other problems along the way, so I'm writing them down for future reference.

Preparation

  • A VPS with direct access to the open internet. If you plan to set this up yourself, it's essential. I use Linode with Ubuntu 16.04
  • Mac and iOS devices
  • Online UUID generator: https://www.uuidgenerator.net/. This UUID will be used as the password in your config
  • Installers for Mac and PC
  • A US Apple ID
  • A Visa credit card (optional)

Install and Run the Server

Installation is extremely simple. Just run one command:

bash <(curl -L -s https://install.direct/go.sh)

Once the automatic installation succeeds, you'll see v2Ray v.x.x.x is installed. The main program and config file are at

1
2
3
/usr/bin/v2ray/v2ray: the V2Ray main program;
/etc/v2ray/config.json: the server config file;

Edit /etc/v2ray/config.json to configure the server.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 10086, # Server port; choose your own
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "xxxxxxxxxxxxxxxxxx", # Generate with the online tool and keep it safe
"level": 1,
"alterId": 64
}
]
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
}
]
}
}
}

Write down the port, id, and alterId values from this config. You'll need them to configure the client.

Run V2Ray on the server with service v2ray start. Later, you can control it with service v2ray (start|stop|status|reload|restart|force-reload). The server is now configured and running.

Client Setup

iOS Setup

On iOS, Shadowrocket and Shadowray are made by the same developer, and both support VMess. Both apps have been removed from the China App Store, so you need a US account to buy them. There are plenty of tutorials online on how to register a US account. Also note that both apps are paid. I couldn't buy them with either my China Merchants Bank Visa multi-currency card or PayPal, and you may run into the same problem. The fix: sign in to Apple's website with your US account and use a Visa card to buy an iTunes Gift Card. If you don't have a credit card, you can turn to Taobao (be careful of the risks). It takes a few hours to receive the card. Once it's activated, you can use it to buy both apps in the App Store.

In Shadowray, Add a Server Using the Server Settings Above

IMG_0357

In Shadowrocket, Add a Node. Choose VMess as the Type; Everything Else Is the Same.

IMG_0356

Mac Setup

From the downloads list, download the Mac package, v2ray-macos.zip. Unzip and install it, then open Configure... and follow the prompts.

That's it. V2Ray is fully set up, and you can happily use your new ladder to climb over the Great Wall: use Google's high-quality search, watch endlessly creative YouTube videos, or scroll Twitter.

References: