{ "log": { "access": "/var/log/v2ray/access.log", "error": "/var/log/v2ray/error.log", "loglevel": "warning" }, "inbound": { //理论最安全的方式 ws,有条件加上TLS "port": 20080, //开启的端口,建议实用caddy加上TLS加密 "protocol": "vmess", "listen": null, "settings": { "ip": null, "udp": true, "clients": [ { "alterId": 100, "security": "auto", "id": "cf390ac1-595a-4f4b-b56d-6f048f01444c" } ], "auth": null }, "streamSettings": { "network": "ws", //websocket 长连接 "kcpSettings": null, "wsSettings": { "connectionReuse": true, "path": "/home" }, "tcpSettings": null, "tlsSettings": {}, "security": "" } }, "inboundDetour": [ {//最轻负载方式,推荐移动设备 "port": 34001, "protocol": "vmess", //vmess 协议 "settings": { "clients": [ { "id": "7fab440d-f1e9-419e-b7cb-ba6ba9a21374", "level": 0, "security": "auto", //自动选择(运行框架为 AMD64、ARM64 或 s390x 时为aes-128-gcm加密方式,其他情况则为 Chacha20-Poly1305 加密方式) "alterId": 64 } ] }, "streamSettings": { "network": "tcp" //默认tcp时,可直接省略streamSettings } }, {//SS是最通用的方式,但非常容易被检测被墙,下下策 "port": 34000, "protocol": "shadowsocks", // 此段为支持SS协议部分,V2ray不支持SSR "settings": { "method": "aes-256-cfb", "password": "Tanpeng123", "udp": true //是否支持UDP中转,游戏大多数需要,如SSTAP 加速游戏需要此项, } }, {//游戏用,将tcp包转为udp发送,部分服务商对udp限制非常严格,可能反而不如一般tcp,mKCP不一定所有客户端都支持 "port": 34006, //记得打开设置防火墙和安全组规则(如ECS需要设置) "protocol": "vmess", //vmess 协议 "settings": { "clients": [ { "id": "7fab440d-f1e9-419e-b7cb-ba6ba9a21373", "level": 0, "security": "auto", //自动选择(运行框架为 AMD64、ARM64 或 s390x 时为aes-128-gcm加密方式,其他情况则为 Chacha20-Poly1305 加密方式) "alterId": 64 } ] }, "streamSettings": { "network": "kcp" //kcp 可以加速,实际是UDP 协议 } } ], "outbound": { "protocol": "freedom", "settings": {} }, "outboundDetour": [ { "protocol": "freedom", "settings": {} }, { "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" } ] } } }