-
I'm having some difficulties with the api, for some reason most of the methods don't work, let's say the same At the same time, the What can I additionally provide as information to understand what the problem is? xray api statsonline --server=127.0.0.1:10085 --email="[email protected]"
failed to get stats: rpc error: code = Unknown desc = app/stats/command: user>>>[email protected]>>>online not found |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
In order to use the statistics feature, you need to enable the corresponding options in "policy" object and add an empty "stats" object in config file. config.json: {
"log": {
"loglevel": "debug"
},
"api": {
"tag": "api",
"listen": "127.0.0.1:10085",
"services": [
"StatsService"
]
},
"stats": {},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true,
"statsUserOnline": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"inbounds": [
{
"protocol": "vless",
"listen": "127.0.0.1",
"port": 1080,
"settings": {
"clients": [
{
"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
"level": 0,
"email": "[email protected]"
}
],
"decryption": "none"
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
} Query stats. xray api statsquery -s 127.0.0.1:10085 Please note that statistics are not updated in real time. |
Beta Was this translation helpful? Give feedback.
In order to use the statistics feature, you need to enable the corresponding options in "policy" object and add an empty "stats" object in config file.
I don't know much about the "statsUserOnline" feature, sorry I can't help you with that.
config.json: