mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6164] [MERGED] feat(inbounds): improve multi-node online attribution #6126
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#6126
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/6164
Author: @isultanov99
Created: 7/30/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @MHSanaei
Base:
main← Head:inbound-online-attribution📝 Commits (1)
5f1f09bfeat(inbounds): improve multi-node online attribution📊 Changes
5 files changed (+399 additions, -21 deletions)
View changed files
📝
internal/web/runtime/remote.go(+14 -2)📝
internal/web/service/inbound_node.go(+99 -14)📝
internal/web/service/node_origin_guid_test.go(+181 -0)📝
internal/xray/online_test.go(+39 -0)📝
internal/xray/process.go(+66 -5)📄 Description
Summary
This PR improves online-client attribution on the inbounds page for multi-node setups.
Central panels already consume node-scoped online users through
onlinesByGuid, but remote node sync did not carry the matchingactiveInboundssignal. As a result, the frontend could know that a client was online on a node, but not which inbounds on that node had recent traffic, so multi-inbound clients could appear online across too many inbounds.The change makes node traffic snapshots include the existing
/panel/api/clients/activeInboundsendpoint and keeps those active inbound tags in the same GUID-keyed in-memory tree model used for online users.What Changed
activeInboundsduring node traffic sync, best-effort and backward-compatible with older nodes.GetActiveInboundsByGuid.n<nodeID>-prefixed tags.Notes
This does not try to infer an exact
client -> inboundpair because Xray exposes user traffic and inbound traffic as separate stats. The frontend can now gate online clients to active inbounds on the correct node, but when several inbounds on the same node are active in the same grace window, attribution remains best-effort.Older nodes that do not expose
activeInboundskeep the previous fallback behavior: the master still consumes their online users and simply skips active-inbound gating for that node.Validation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.