Configure v2ray or Xray-core proxies with VMess, VLESS, Shadowsocks, or SOCKS5 protocols. Use when creating or editing v2ray/Xray JSON config files with inbounds, outbounds, and routing rules.
v2ray and Xray use a JSON configuration with three core sections: inbounds, outbounds, and routing.
{
"log": { "loglevel": "info" },
"inbounds": [
{
"port": 1080,
"protocol": "socks",
"settings": { "auth": "noauth", "udp": true },
"tag": "socks-in"
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "blocked"
}
],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}
| Protocol | Use case | Supported by |
|---|
vmess | VMess proxy | v2ray, Xray |
vless | Lightweight VMess | Xray |
shadowsocks | SS proxy | v2ray, Xray |
socks | SOCKS4/5 | v2ray, Xray |
trojan | Trojan protocol | Xray |
streamSettings.network)tcp | kcp | ws (WebSocket) | http | grpc | quic
v2ray/examples/:
vmess-server.json / vmess-client.json — VMess over WebSocketvless-xtls.json — VLESS with TLS (Xray)shadowsocks.json — Shadowsocks inboundid field) — generate with: cat /proc/sys/kernel/random/uuiddocker compose -f v2ray/docker-compose.yml up -d
# or: xray run -c v2ray/config.json
v2ray/