v2fly / v2ray-step-by-step

This repo is a fork of ToutyRater/v2ray-guide, we aim to provide a new step-by-step guide of v2ray
https://guide.v2fly.org
Creative Commons Attribution 4.0 International
754 stars 426 forks source link

跟参考指南一样的配置,流量统计输出没有具体用户的信息 #105

Open Rabbit-st opened 4 years ago

Rabbit-st commented 4 years ago

v2ray版本:

[root@localhost v2ray]# /usr/bin/v2ray/v2ray -version
V2Ray 4.21.3 (V2Fly, a community-driven edition of V2Ray.) Custom
A unified platform for anti-censorship.

配置文件:

[root@localhost v2ray]# cat config.json
{
    "stats": {},
    "api": {
        "tag": "api",
        "services": [
            "StatsService"
        ]
    },
    "policy": {
        "levels": {
            "0": {
                "statsUserUplink": true,
                "statsUserDownlink": true
            }
        },
        "system": {
            "statsInboundUplink": true,
            "statsInboundDownlink": true
        }
    },
    "inbounds": [
        {
            "tag": "tcp",
            "port": 3307,
            "protocol": "vmess",
            "settings": {
                "clients": [
                    {
                        "email": "auser",
                        "id": "e731f153-4f31-49d3-9e8f-ff8f396135ef",
                        "level": 0,
                        "alterId": 64
                    },
                    {
                        "email": "buser",
                        "id": "e731f153-4f31-49d3-9e8f-ff8f396135ee",
                        "level": 0,
                        "alterId": 64
                    }
                ]
            }
        },
        {
            "listen": "127.0.0.1",
            "port": 10085,
            "protocol": "dokodemo-door",
            "settings": {
                "address": "127.0.0.1"
            },
            "tag": "api"
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "settings": {}
        }
    ],
    "routing": {
        "settings": {
            "rules": [
                {
                    "inboundTag": [
                        "api"
                    ],
                    "outboundTag": "api",
                    "type": "field"
                }
            ]
        },
        "strategy": "rules"
    }
} 

我的输出:

[root@localhost v2ray]# /usr/bin/v2ray/v2ctl api --server=127.0.0.1:10085 StatsService.QueryStats ''
stat: <
  name: "inbound>>>tcp>>>traffic>>>uplink"
>
stat: <
  name: "inbound>>>tcp>>>traffic>>>downlink"
>
stat: <
  name: "inbound>>>api>>>traffic>>>uplink"
  value: 1306
>
stat: <
  name: "inbound>>>api>>>traffic>>>downlink"
  value: 1339
>

参考指南的输出

$ /usr/bin/v2ray/v2ctl api --server=127.0.0.1:10085 StatsService.QueryStats '' stat: < name: "inbound>>>ws>>>traffic>>>uplink" value: 3350713

stat: < name: "inbound>>>ss>>>traffic>>>downlink" value: 1704

stat: < name: "user>>>u3@ws>>>traffic>>>uplink" value: 2810759

stat: < name: "user>>>u9@ss>>>traffic>>>uplink" value: 1776

我的输出中看不到具体用户的统计信息,是新版不支持了吗,还是配置需要做改动?