[GH-ISSUE #5653] [Feature]: Current download speed of each client #3936

Closed
opened 2026-10-31 20:36:00 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @artslay on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5653

Originally assigned to: @NikanZeyaei on GitHub.

The download speed isn't showing up for the client; when the statistics display a overall download speed, I can't tell where it's coming from—whether it's the server itself or someone downloading a large amount of data.

Describe the solution you'd like

Display the client download speed in real-time, similar to the "Inbounds" tab.

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @artslay on GitHub (Jun 29, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5653 Originally assigned to: @NikanZeyaei on GitHub. ### Is your feature request related to a problem? The download speed isn't showing up for the client; when the statistics display a overall download speed, I can't tell where it's coming from—whether it's the server itself or someone downloading a large amount of data. ### Describe the solution you'd like Display the client download speed in real-time, similar to the "Inbounds" tab. ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:36:00 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 29, 2026):

Per-client real-time speed is not currently implemented; only per-inbound real-time speed exists. This is a valid feature gap.

What exists today

  • The Inbounds tab shows live upload/download speeds per inbound. This works because frontend/src/pages/inbounds/useInbounds.ts computes speed from 5-second deltas (bytes received divided by TRAFFIC_POLL_INTERVAL_S = 5), driven by WebSocket pushes from internal/web/job/xray_traffic_job.go.
  • The Clients table shows only cumulative up/down totals from the client_traffics database table. No per-client speed column is rendered anywhere in the frontend.

Why adding it is feasible

The underlying data is already available:

  1. Xray reports per-client byte counters via the gRPC Stats API under names matching user>>>email>>>traffic>>>(downlink|uplink) (internal/xray/api.go).
  2. The 5-second polling job (internal/web/job/xray_traffic_job.go) already reads these deltas and broadcasts them over WebSocket as a MessageTypeClientStats payload containing ClientTraffic structs with per-client Up/Down delta values.
  3. The WebSocket hub in internal/web/websocket/hub.go already delivers these messages to connected frontends.

The frontend currently consumes the client_stats WebSocket event but discards the delta information, displaying only the cumulative totals it fetches from the REST API. A per-client speed column would require tracking successive delta values on the frontend (analogous to how applyTrafficEvent works for inbounds in useInbounds.ts) and computing speed = delta bytes / 5 seconds, then displaying the result with SizeFormatter.speedFormat().

Scope of a PR

The changes would be confined to the frontend (frontend/src/ — likely the clients/inbounds list component and the WebSocket event handler) with no backend or database schema changes required, since the delta data is already being transmitted.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4830768294 --> @github-actions[bot] commented on GitHub (Jun 29, 2026): Per-client real-time speed is not currently implemented; only per-inbound real-time speed exists. This is a valid feature gap. **What exists today** - The Inbounds tab shows live upload/download speeds per inbound. This works because `frontend/src/pages/inbounds/useInbounds.ts` computes speed from 5-second deltas (bytes received divided by `TRAFFIC_POLL_INTERVAL_S = 5`), driven by WebSocket pushes from `internal/web/job/xray_traffic_job.go`. - The Clients table shows only cumulative `up`/`down` totals from the `client_traffics` database table. No per-client speed column is rendered anywhere in the frontend. **Why adding it is feasible** The underlying data is already available: 1. Xray reports per-client byte counters via the gRPC Stats API under names matching `user>>>email>>>traffic>>>(downlink|uplink)` (`internal/xray/api.go`). 2. The 5-second polling job (`internal/web/job/xray_traffic_job.go`) already reads these deltas and broadcasts them over WebSocket as a `MessageTypeClientStats` payload containing `ClientTraffic` structs with per-client `Up`/`Down` delta values. 3. The WebSocket hub in `internal/web/websocket/hub.go` already delivers these messages to connected frontends. The frontend currently consumes the `client_stats` WebSocket event but discards the delta information, displaying only the cumulative totals it fetches from the REST API. A per-client speed column would require tracking successive delta values on the frontend (analogous to how `applyTrafficEvent` works for inbounds in `useInbounds.ts`) and computing speed = delta bytes / 5 seconds, then displaying the result with `SizeFormatter.speedFormat()`. **Scope of a PR** The changes would be confined to the frontend (`frontend/src/` — likely the clients/inbounds list component and the WebSocket event handler) with no backend or database schema changes required, since the delta data is already being transmitted. *This reply was generated automatically; a maintainer may follow up.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3936
No description provided.