mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4886] [Feature]: server speed display #3417
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3417
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bl00dychains on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4886
add the ability to view the consumed speed in the inbounds section
@github-actions[bot] commented on GitHub (Jun 4, 2026):
Thanks for the request! Here's what the codebase currently does and what would be needed to add per-inbound speed.
What already exists
XrayTrafficJob(web/job/xray_traffic_job.go) runs every 5 seconds. Each cycle it calls Xray's gRPCQueryStatsAPI, computes per-inbound byte deltas (bytes transferred since the last poll), and broadcasts them to the frontend via WebSocket as atrafficmessage with this shape:So the raw per-inbound throughput data is already flowing to the frontend every 5 s. The
Inbound.Up/Inbound.Downfields in the database are cumulative totals (not speed); the speed signal lives exclusively in the WebSocket delta stream.The main-page "overall speed" widget reads system-wide NIC throughput from
gopsutil(Status.NetIO.Up/Downinweb/service/server.go) — that's a different data source and sums all interfaces, not per-inbound.What is missing for this feature
The frontend inbounds list does not yet consume the per-inbound
trafficsdeltas to display a live speed column. Implementing it would require:frontend/): In the WebSockettraffichandler, map eachtraffics[i].tagto the corresponding inbound row and computebytes / 5s→ display as "↑ X KB/s ↓ Y KB/s" (the 5-second polling interval is fixed server-side).If you'd like to implement this yourself, the relevant files are:
web/job/xray_traffic_job.go— where the WebSocket broadcast is assembledweb/websocket/hub.go/notifier.go—MessageTypeTrafficconstant andBroadcastTrafficfrontend/— React inbounds list component that renders the inbound rows