Skip to content

VLESS(without flow): incorrect traffic calculation #5446

@kastov

Description

@kastov

During testing, I discovered issues with traffic statistics calculation.
The issue occurs exclusively with VLESS configuration when flow is disabled. Other protocols (tested with Trojan) do not exhibit this problem.

Test Case

Below are two screenshots demonstrating the issue. Both configurations are identical except for the flow setting.
Test procedure: After connecting via VLESS, download a 500 MB test file.
Expected statistics: user>>>downlink should show ~500MB.

Observed Behavior

As shown in screenshot №1, the statistics for user>>>4>>>traffic>>>downlink are inexplicably multiplied by 2 without any apparent reason.

This results in incorrect traffic accounting for users, showing double the actual usage when using VLESS without flow configuration.

  • Affected versions: 25.12.8, 25.10.15 (other versions not tested)
  • Protocol: VLESS without flow ("flow": "")
  • Not affected: VLESS with flow (xtls-rprx-vision), Trojan

Test Case №1 – VLESS+Reality with flow: ""

Image

Test Case №2 – VLESS+Reality with flow: "xtls-rprx-vision"

Image

Xray Config

{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "tag": "VLESS_PRODUCTION",
      "port": 443,
      "listen": "0.0.0.0",
      "protocol": "vless",
      "settings": {
        "flow": "xtls-rprx-vision", // depends on test case
        "clients": [],
        "decryption": "none"
      },
      "sniffing": {
        "enabled": true,
        "destOverride": ["http","tls","quic"]
      },
      "streamSettings": {
        "network": "raw",
        "security": "reality",
        "realitySettings": {
          "show": false,
          "xver": 0,
          "target": "<omitted>:443",
          "shortIds": [""],
          "privateKey": "<omitted>",
          "serverNames": ["<omitted>"]
        }
      }
    }
  ],
  "outbounds": [
    {"tag": "DIRECT", "protocol": "freedom"},
    {"tag": "BLOCK", "protocol": "blackhole"}
  ],
  "routing": {"rules": []}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions