qist / xray-ui

MIT License
293 stars 59 forks source link

流量重置以后就无法再继续统计 #138

Closed flamehe closed 4 months ago

flamehe commented 4 months ago

Welcome

Description of the problem,screencshot would be good

在入站中重置流量计数以后,所有节点都不再统计流量了 重现步骤: 1.添加任意节点 2.使用客户端连接节点,产生流量 3.重置一个节点的流量 在此以后所有节点的流量都不再统计了,重启也没用

Version of xray-ui

v1.8.19

xray-ui log reports or xray log

2024/03/10 09:55:16 WARNING - get xray traffic failed: rpc error: code = Unimplemented desc = unknown service xray.app.stats.command.StatsService

qist commented 4 months ago

xray升级到最新版本。看看

flamehe commented 4 months ago

xray升级到最新版本。看看

xray就是最新的1.8.8

qist commented 4 months ago

我先测试一下我这边没遇到那个问题。

qist commented 4 months ago

你看看setting下面xray 相关设置 相关配置api 你是否修改 下面是默认的,可以参考修改。

{
  "log": {
    "access": "none",
    "error": "none",
    "loglevel": "info"
  },
  "api": {
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ],
    "tag": "api"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      },
      "tag": "api"
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "tag": "blocked"
    }
  ],
  "policy": {
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    },
    "levels": {
      "0": {
        "handshake": 2,
        "connIdle": 120,
        "uplinkOnly": 1,
        "downlinkOnly": 1
      }
    }
  },
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "type": "field",
        "domain": [
          "www.gstatic.com"
        ],
        "outboundTag": "direct"
      },
      {
        "type": "field",
        "domain": [
          "geosite:category-ads-all",
          "geosite:cn",
          "geosite:geolocation-cn"
        ],
        "outboundTag": "blocked"
      },
      {
        "type": "field",
        "ip": [
          "geoip:cn"
        ],
        "outboundTag": "blocked"
      },
      {
        "type": "field",
        "protocol": [
          "bittorrent"
        ],
        "outboundTag": "blocked"
      }
    ]
  },
  "stats": {}
}
qist commented 4 months ago

我重新安装的也可以统计数据的。 image

flamehe commented 4 months ago

IMG_20240311_123612 是用这里的重置流量,而不是重装 另外我这个入站还设了流量限制,不知道是不是有关,不过流量限制去掉也还是不统计 等会我试试全部重装还会不会有问题

qist commented 4 months ago

是访问不了xray api 你看看配置文件StatsService 这个有配置没。api 那些有没动过,我都测试过限制流量都没有问题的。

flamehe commented 4 months ago

是访问不了xray api 你看看配置文件StatsService 这个有配置没。api 那些有没动过,我都测试过限制流量都没有问题的。

我重新用上面这个default配置可以统计流量了,我的那个配置和default的区别只是在于我加了一个warp的分流而已。用了default以后我又把warp的配置加回来也可以统计了😂 这是我加了warp后的配置:

{ "log": { "access": "none", "error": "none", "loglevel": "info" }, "api": { "services": [ "HandlerService", "LoggerService", "StatsService" ], "tag": "api" }, "inbounds": [ { "listen": "127.0.0.1", "port": 62789, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" }, "tag": "api" } ], "outbounds": [ { "protocol": "freedom", "tag": "direct" }, { "tag":"WARP-interface-v4", "protocol":"freedom", "settings":{ "domainStrategy":"UseIPv4" }, "streamSettings":{ "sockopt":{ "interface":"warp", "tcpFastOpen":true } } }, { "tag":"WARP-interface-v6", "protocol":"freedom", "settings":{ "domainStrategy":"UseIPv6" }, "streamSettings":{ "sockopt":{ "interface":"warp", "tcpFastOpen":true } } }, { "protocol": "blackhole", "tag": "blocked" } ], "policy": { "system": { "statsInboundDownlink": true, "statsInboundUplink": true }, "levels": { "0": { "handshake": 2, "connIdle": 120, "uplinkOnly": 1, "downlinkOnly": 1 } } }, "routing": { "domainStrategy": "IPIfNonMatch", "rules": [ { "inboundTag": [ "api" ], "outboundTag": "api", "type": "field" }, { "type": "field", "domain": [ "www.gstatic.com" ], "outboundTag": "direct" }, { "type":"field", "domain":[ "geosite:google", "googleadservices.com", "ad.doubleclick.net", "io.clickguard.com", "geosite:openai", "geosite:reddit", "geosite:twitter", "geosite:github", "io.clickguard.com", "ping0.cc" ], "outboundTag":"WARP-interface-v6" }, { "type":"field", "domain":[ "geosite:netflix", "geosite:bahamut", "geosite:hbo", "geosite:disney", "geosite:bbc", "geosite:4chan", "geosite:fox", "geosite:abema", "geosite:dmm", "geosite:niconico", "geosite:pixiv", "geosite:viu", "ip.gs" ], "outboundTag":"WARP-interface-v4" }, { "type": "field", "domain": [ "geosite:category-ads-all" ], "outboundTag": "blocked" }, { "type": "field", "ip": [ "geoip:cn" ], "outboundTag": "direct" }, { "type": "field", "protocol": [ "bittorrent" ], "outboundTag": "blocked" } ] }, "stats": {} }

qist commented 4 months ago

你有对比两个配置有不同的地方么。现在重置流量看看能用不。

flamehe commented 4 months ago

现在可以计流量了,但现在的配置和之前一样的,就是加了warp的分流,有点玄学了😂