配置含义请官网查阅, /usr/local/etc/v2ray/config.json
:
{ "log": { "loglevel": "warning" }, "inbounds": [ { "port": <v2ray-port>, "listen": "127.0.0.1", "tag": "vmess-inbound", "protocol": "vmess", "settings": { "auth": "noauth", "udp": false, "ip": "127.0.0.1", "clients": [ { "id": "<uuid>", "level": 0, "alterId": 0, }, ] }, "streamSettings": { "network": "h2", "security": "none", "httpSettings": { "path": "<http2-path>", "host": ["<domain>"] }, "tlsSettings": { "serverName": "<domain>" } }, "sniffing": { "enabled": true, "destOverride": ["http", "tls"] } } ], "outbounds": [ { "protocol": "freedom", "settings": {}, "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" } ], "routing": { "domainStrategy": "IPOnDemand", "rules": [ { "type": "field", "ip": ["geoip:private"], "outboundTag": "blocked" }, { "type": "field", "domain": ["geosite:category-ads"], "outboundTag": "blocked" } ] }, "dns": { "hosts": { "domain:v2ray.com": "www.vicemc.net", "domain:github.io": "pages.github.com", "domain:wikipedia.org": "www.wikimedia.org", "domain:shadowsocks.org": "electronicsrealm.com" }, "servers": [ "1.1.1.1", { "address": "114.114.114.114", "port": 53, "domains": ["geosite:cn"] }, "8.8.8.8", "localhost" ] }, "policy": { "levels": { "0": { "uplinkOnly": 0, "downlinkOnly": 0, "bufferSize": 204800, "handshake": 10 } }, "system": { "statsInboundUplink": false, "statsInboundDownlink": false, "statsOutboundUplink": false, "statsOutboundDownlink": false } } }