[anti-censorship-team] Next week's reading group: V2Ray & VMess

David Fifield david at bamsoftware.com
Thu Jun 11 01:27:50 UTC 2020


On Thu, Jun 04, 2020 at 05:45:22PM -0600, David Fifield wrote:
> There is a beginner's guide to setting up V2Ray:
> https://guide.v2fly.org/en_US/

The guide doesn't really explain how to configure the client. Here is
what worked for me.

On the server:

```
# wget https://install.direct/go.sh
# bash go.sh
...
PORT:36685
UUID:799e8b6b-d87e-41ce-b214-82ac581802cf
...
# cat /etc/v2ray/config.json
{
  "inbounds": [{
    "port": 36685,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "799e8b6b-d87e-41ce-b214-82ac581802cf",
          "level": 1,
          "alterId": 64
        }
      ]
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  },{
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  }],
  "routing": {
    "rules": [
      {
        "type": "field",
        "ip": ["geoip:private"],
        "outboundTag": "blocked"
      }
    ]
  }
}
# systemctl start v2ray
```

Then on the client,

```
# wget https://install.direct/go.sh
# bash go.sh
# vi /etc/v2ray/config.json
# cat /etc/v2ray/config.json 
{
  "inbounds": [{
    "listen": "127.0.0.1",
    "port": 1080,
    "protocol": "socks"
  }],
  "outbounds": [{
    "protocol": "vmess",
    "settings": {
      "vnext": [{
        "address": "173.255.250.95",
        "port": 36685,
        "users": [{
          "id": "799e8b6b-d87e-41ce-b214-82ac581802cf",
          "level": 1,
          "alterId": 64
        }]
      }]
    }
  }]
}
# systemctl start v2ray
```

The server is configured with a single "inbound", which uses VMess. It
has two "outbound"s. The "freedom" outbound means to make a direct
outgoing TCP connection, with no further proxying. The "blackhole"
outbound denies the outgoing connection. Outgoing traffic goes to the
"freedom" outbound by default, unless it is tagged with the "blocked"
tag that is added by the "geoip:private" routing rule.

The client has one "socks" inbound and one "vmess" outbound. I guess the
connection between them is implicit.

On the server, you can configure multiple clients with different "id"s.
On the client, you can also configure an array of multiple "id"s. I'm
not sure why that is or how it decides which "id" to use.



More information about the anti-censorship-team mailing list