You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enabled statsUserOnline in policy level 0 (the default level for all clients, as none have explicit level set).
Restarted Xray.
Connected two clients(same phone, btw) (using VLESS+REALITY) and generated some traffic.
Queried statistics using:
docker exec -it xray bash -c "xray api statsquery --server=127.0.0.1:10085"
Why are online user statistics not appearing despite statsUserOnline: true in policy level 0? Is there any additional configuration required? Or is this a known limitation/ bug?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Xray version: 25.12.8 (from xray --version)
Environment: Docker container (teddysun/xray:latest) with host networking
API port: 10085 (dokodemo-door inbound)
Here is config:
{
"log": {
"loglevel": "info",
"access": "/var/log/xray/access.log",
"error": "/var/log/xray/error.log"
},
"api": {
"tag": "api",
"services": [
"HandlerService",
"StatsService"
]
},
"stats": {},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true,
"statsUserOnline": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"inbounds": [
{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "permanent_test_user",
"email": "permanent_test_user@example.com",
"flow": ""
},
{
"id": "a9e7f88c-f6f1-44bd-905a-64879ab84cbc",
"email": "user",
"flow": ""
},
{
"id": "86a82955-8657-43c6-ae74-af724bb06299",
"email": "user1@example.com",
"flow": ""
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false,
"dest": "www.google.com:443",
"serverNames": ["www.google.com"],
"privateKey": "private-key",
"shortIds": [
"525ec83f86",
"64061320d2",
"04f8996da7",
"0a041b9462"
]
}
}
},
{
"listen": "127.0.0.1",
"port": 10085,
"protocol": "dokodemo-door",
"settings": { "address": "127.0.0.1" },
"tag": "api"
}
],
"outbounds": [
{ "protocol": "freedom", "tag": "direct" },
{ "protocol": "blackhole", "tag": "blocked" }
],
"routing": {
"rules": [
{
"inboundTag": ["api"],
"outboundTag": "api",
"type": "field"
}
]
}
}
What I did:
Enabled statsUserOnline in policy level 0 (the default level for all clients, as none have explicit level set).
Restarted Xray.
Connected two clients(same phone, btw) (using VLESS+REALITY) and generated some traffic.
Queried statistics using:
docker exec -it xray bash -c "xray api statsquery --server=127.0.0.1:10085"
Got result:
{
"stat": [
{
"name": "user>>>user1@example.com>>>traffic>>>downlink",
"value": 14722
},
{
"name": "inbound>>>api>>>traffic>>>uplink",
"value": 170
},
{
"name": "inbound>>>api>>>traffic>>>downlink",
"value": 24
},
{
"name": "user>>>permanent_test_user@example.com>>>traffic>>>uplink",
"value": 26272
},
{
"name": "user>>>permanent_test_user@example.com>>>traffic>>>downlink",
"value": 63520
},
{
"name": "user>>>user1@example.com>>>traffic>>>uplink",
"value": 6863
}
]
}
Why are online user statistics not appearing despite statsUserOnline: true in policy level 0? Is there any additional configuration required? Or is this a known limitation/ bug?
Beta Was this translation helpful? Give feedback.
All reactions