{ "log" : { "access": "/var/log/v-2ray/access.log", "error": "/var/log/v-2ray/error.log", "loglevel": "warning" }, "inbounds": [ { "tag": "tg-in", "port": 1234, "protocol": "mtproto", // 入站协议为 VMess "settings": { "users": [{"secret": "**********************"}] } }, { "tag": "socks-in", "port": 4321, "protocol": "socks", "settings": { "auth": "password", "accounts": [ { "user": "****", "pass": "****" } ], "udp": true, "ip": "127.0.0.1", "userLevel": 0 } } ], // ========== BEGIN STEP 1 ========== // 国内中转服务器当作国外服务器的“客户端” // 国际流量发往国外服务器上 "outbounds": [ { "tag": "vmess-out", "protocol": "vmess", "settings": { "vnext": [ { "address": "******", "port": 443, "users": [ { "id": "******", "alterId": 233, "email": "t@t.tt", "security": "auto" } ] } ], "servers": null, "response": null }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "allowInsecure": false, "serverName": "******" }, "tcpSettings": null, "kcpSettings": null, "wsSettings": { "connectionReuse": true, "path": "/", "headers": { "Host": "*****" } }, "httpSettings": null, "quicSettings": null }, "mux": { "enabled": true, "concurrency": 8 } }, { "tag": "tg-out", "protocol": "mtproto", "settings": {}, "proxySettings": { "tag": "vmess-out" // 把 tg-out 的流量由 vmess-out 转发 } }, { "tag": "tag-freedom", "protocol": "freedom", "settings": {}, "proxySettings": { "tag": "vmess-out" } } ], // ========== END STEP 1 ========== "routing": { // 路由设置 "domainStrategy": "IPOnDemand", "strategy": "rules", "rules": [ { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" }, { "type": "field", "inboundTag": ["socks-in"], "outboundTag": "tag-freedom" } ] } }