{ "log": { "access": "/var/log/xray-core/access.log", "error": "/var/log/xray-core/error.log", "loglevel": "warning", "dnsLog": false, "maskAddress": "" }, "dns": { "tag": "dns-in", "servers": ["localhost"], "queryStrategy": "UseIPv4" }, "inbounds": [ { "tag": "tproxy-in", "listen": "0.0.0.0", "port": 61219, "protocol": "dokodemo-door", "settings": { "followRedirect": true, "network": "tcp,udp" }, "streamSettings": { "sockopt": { "tproxy": "tproxy" } }, "sniffing": { "enabled": false } }, { "tag": "socks-in", "listen": "127.0.0.1", "port": 1080, "protocol": "socks", "settings": { "auth": "password", "accounts": [ { "user": "embargo", "pass": "moistnes12" } ], "udp": true }, "sniffing": { "enabled": false } }, { "tag": "http-in", "listen": "0.0.0.0", "port": 8080, "protocol": "http", "settings": { "allowTransparent": false }, "sniffing": { "enabled": false } } ], "outbounds": [ {% for item in xray_outbounds %} { "tag": "vless-{{ item.tag }}", "protocol": "vless", "settings": { "vnext": [ { "address": "{{ item.address }}", "port": 443, "users": [ { "id": "{{ item.xray_id }}", "flow": "xtls-rprx-vision", "encryption": "{{ item.xray_encryption }}" } ] } ], "domainStrategy": "UseIPv4" }, "streamSettings": { "network": "xhttp", "xhttpSettings": { "path": "{{ item.xray_xhttp_path }}", "mode": "stream-one" }, "security": "tls", "tlsSettings": { "alpn": [ "h2", "h3" ], "fingerprint": "firefox" } } }, {% endfor %} { "tag": "direct", "protocol": "freedom", "settings": { "domainStrategy": "UseIPv4" } }, { "tag": "blocked", "protocol": "blackhole", "settings": { "response": { "type": "none" } } } ], "policy": { "levels": { "0": { "handshake": 4, "connIdle": 300, "uplinkOnly": 2, "downlinkOnly": 5, "statsUserUplink": false, "statsUserDownlink": false, "statsUserOnline": false, "bufferSize": 512 } }, "system": { "statsInboundUplink": false, "statsInboundDownlink": false, "statsOutboundUplink": false, "statsOutboundDownlink": false } }, "observatory": { "subjectSelector": ["vless-"], "probeUrl": "https://www.google.com/generate_204", "probeInterval": "30s", "enableConcurrency": true }, "routing": { "domainStrategy": "IPIfNonMatch", {% if xray_outbounds | length > 1 %} "balancers": [ { "tag": "balancer-vless", "selector": ["vless-"], "strategy": { "type": "leastLoad", "settings": { "costs": [ {% for item in xray_outbounds %} { "match": "vless-{{ item.tag }}", "value": {{ item.value }}}{{ "," if not loop.last else "" }} {% endfor %} ] } } } ], {% endif %} "rules": [ { "type": "field", "protocol": ["bittorrent"], "outboundTag": "direct" }, { "type": "field", "inboundTag": [ "tproxy-in", "socks-in", "http-ip" ], "balancerTag": "{{ 'balancer-vless' if xray_outbounds | length > 1 else 'vless-' ~ xray_outbounds[0].tag }}" } ] } }