This post is a tutorial about setting V2Ray on Linux server and Windowx/Mac client.
FIRST OF ALL, YOU NEED A SERVER.
For Server:
bash <(curl -L -s https://install.direct/go.sh)
the config.json
file
{
"inbounds": [{
"port": 10086, // 服务器监听端口,必须和上面的一样
"protocol": "vmess",
"settings": {
"clients": [{ "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" }]
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
}]
}
sudo systemctl start v2ray
For client:
For Mac
Please Download V2RayX
Or just brew cask install v2rayx
{
"inbounds": [{
"port": 1080, // SOCKS 代理端口,在浏览器中需配置代理并指向这个端口
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
}
}],
"outbounds": [{
"protocol": "vmess",
"settings": {
"vnext": [{
"address": "server", // 服务器地址,请修改为你自己的服务器 ip 或域名
"port": 10086, // 服务器端口
"users": [{ "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" }]
}]
}
},{
"protocol": "freedom",
"tag": "direct",
"settings": {}
}],
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "direct"
}]
}
}