mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5204] [CLOSED] fix: sync global traffic to nodes to enforce accurate client termination and UI reporting #5819
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#5819
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5204
Author: @rqzbeh
Created: 6/11/2026
Status: ❌ Closed
Base:
main← Head:fix-global-traffic-sync📝 Commits (2)
271a7d5fix: sync global traffic to nodes to enforce accurate client termination and UI reporting533c239Merge branch 'main' into fix-global-traffic-sync📊 Changes
5 files changed (+139 additions, -9 deletions)
View changed files
📝
internal/web/controller/inbound.go(+26 -0)📝
internal/web/job/node_traffic_sync_job.go(+18 -0)📝
internal/web/runtime/remote.go(+17 -0)📝
internal/web/service/inbound_node.go(+18 -9)➕
internal/web/service/inbound_traffic_global.go(+60 -0)📄 Description
The Issue:
Currently, remote nodes only track local client traffic. If a client is attached to multiple nodes, their global traffic may exceed their limit (e.g. 5GB total, but only 2GB on Node A). The Master correctly disables the user and sends a config update (\enable=false) to the node. However, Xray's hot-reload does not kill existing connections. Because the node's local traffic (\2GB) is less than the limit (\5GB), the node's \XrayTrafficJob\ never triggers a local \RestartXray(). This allows the user to stay connected and use hundreds of GBs unchecked. Additionally, the Node's UI inaccurately shows only local usage instead of global usage.
The Solution:
This PR introduces bidirectional traffic syncing.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.