Closed shyboy0415 closed 1 year ago
请检查配置模板的设置,开启单个用户的流量统计需要配置policy,如下所示:
"policy": {
"levels": {
"0": {
"handshake": 10,
"connIdle": 100,
"uplinkOnly": 2,
"downlinkOnly": 3,
"statsUserUplink": true,
"statsUserDownlink": true,
"bufferSize": 10240
}
},
"system": {
"statsInboundDownlink": true,
"statsInboundUplink": true
}
},
完整配置参考:
{
"log": {
"access": "/usr/local/x-ui/bin/access.log",
"error": "/usr/local/x-ui/bin/error.log",
"loglevel": " debug",
"dnsLog": true
},
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"dns": {
"servers": [
"127.0.0.1"
]
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
},
"tag": "blocked"
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
},
"tag": "blockedByIp"
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
},
"tag": "blockedByDomain"
}
],
"policy": {
"levels": {
"0": {
"handshake": 10,
"connIdle": 100,
"uplinkOnly": 2,
"downlinkOnly": 3,
"statsUserUplink": true,
"statsUserDownlink": true,
"bufferSize": 10240
}
},
"system": {
"statsInboundDownlink": true,
"statsInboundUplink": true
}
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"domainMatcher": "hybrid",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"ip": [
"geoip:cn"
],
"outboundTag": "blockedByIp",
"type": "field"
},
{
"type": "field",
"domain": [
"geosite:category-ads-all",
"geosite:cn",
"geosite:tld-cn",
"geosite:private",
"geosite:category-games@cn"
],
"outboundTag": "blockedByDomain"
},
{
"outboundTag": "blocked",
"protocol": [
"bittorrent"
],
"type": "field"
}
]
},
"stats": {}
}
谢谢
Welcome
Description of the problem,screencshot would be good
为什么单端口多用户情况下,流量统计都是0?有什么限制吗? 端口下的统计是正常的
Version of x-ui
x-ui log or xray log