[GH-ISSUE #4778] [Feature]: Display Inbound Tag / Port context in Web UI (Connections) and Telegram Bot for clients with multiple attached inbounds #3314

Open
opened 2026-10-31 20:31:34 +07:00 by bsakaguchi · 2 comments
Owner

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

With the introduction of the "Attached Inbounds" feature, an administrator can now cleanly link a single client profile (email) to multiple inbounds/ports simultaneously to generate a unified subscription link. This is a massive improvement for user database organization, but it creates a critical blind spot in server monitoring:
​Complete Loss of Routing Context: Because the client now uses a single identifier (email) across all assigned inbounds, it is completely impossible to determine which specific inbound, protocol, or port the client is actively connected to. Both the Web UI and the Telegram Bot completely lose this vital context.
​Blind Troubleshooting: If a client experiences a poor connection on a backup port or accidentally triggers a traffic limit alert, the administrator only sees that the generic email triggered the event. There is no way to know whether the issue occurred on the primary VLESS-Reality inbound, a secondary SplitHTTP port, or an alternative fallback gateway without manually combing through raw system logs via SSH.

Describe the solution you'd like

Since the Xray-core backend already processes and associates session data with specific inbound tags internally, we need this routing context exposed to the panel's front-facing utilities:
​Web UI Optimization (Connections Tab): Add a dedicated Inbound Tag or Port column to the active connections table. This will allow administrators to see exactly where traffic is being routed in real time.
​Telegram Bot Enhancements: Include inbound context variables (such as {{inbound.tag}} and {{inbound.port}}) into the bot's automated alert and summary message templates.
​Example of the requested Telegram notification change:
​Current Behavior: Client "sudo" has exceeded the traffic limit.
​Requested Behavior: Client "sudo" [inbound-443] has exceeded the traffic limit.

Alternatives you've considered

The only current workaround is maintaining old-style duplicate client configurations (e.g., creating separate sudo and sudo_R entries for each inbound), which actively conflicts with the new strict UNIQUE constraints on sub_id fields in recent database migrations and breaks unified subscriptions.

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 @Speert on GitHub (Jun 1, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4778 ### Is your feature request related to a problem? With the introduction of the "Attached Inbounds" feature, an administrator can now cleanly link a single client profile (email) to multiple inbounds/ports simultaneously to generate a unified subscription link. This is a massive improvement for user database organization, but it creates a critical blind spot in server monitoring: ​Complete Loss of Routing Context: Because the client now uses a single identifier (email) across all assigned inbounds, it is completely impossible to determine which specific inbound, protocol, or port the client is actively connected to. Both the Web UI and the Telegram Bot completely lose this vital context. ​Blind Troubleshooting: If a client experiences a poor connection on a backup port or accidentally triggers a traffic limit alert, the administrator only sees that the generic email triggered the event. There is no way to know whether the issue occurred on the primary VLESS-Reality inbound, a secondary SplitHTTP port, or an alternative fallback gateway without manually combing through raw system logs via SSH. ### Describe the solution you'd like Since the Xray-core backend already processes and associates session data with specific inbound tags internally, we need this routing context exposed to the panel's front-facing utilities: ​Web UI Optimization (Connections Tab): Add a dedicated Inbound Tag or Port column to the active connections table. This will allow administrators to see exactly where traffic is being routed in real time. ​Telegram Bot Enhancements: Include inbound context variables (such as {{inbound.tag}} and {{inbound.port}}) into the bot's automated alert and summary message templates. ​Example of the requested Telegram notification change: ​Current Behavior: Client "sudo" has exceeded the traffic limit. ​Requested Behavior: Client "sudo" [inbound-443] has exceeded the traffic limit. ### Alternatives you've considered The only current workaround is maintaining old-style duplicate client configurations (e.g., creating separate sudo and sudo_R entries for each inbound), which actively conflicts with the new strict UNIQUE constraints on sub_id fields in recent database migrations and breaks unified subscriptions. ### 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.
Author
Owner

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

Thank you for the well-detailed feature request, @Speert!

This is a valid gap introduced by the Attached Inbounds feature. When a single client email is linked to multiple inbounds, the Connections tab and Telegram Bot alerts lose the per-inbound context that was previously implicit (because each client mapped to exactly one inbound).

A few notes on the scope and feasibility:

Web UI – Connections Tab
The active connections data comes from Xray-core's /stats/ API (via statsService). The connection session data returned by Xray does not natively expose the inbound tag per-connection in a straightforward way today. Surfacing this would likely require correlating traffic stats with inbound tag data internally. This is technically non-trivial, but the request is reasonable.

Telegram Bot Alerts
Adding inbound context (e.g. [inbound-tag]) to traffic-limit and similar notifications appears more feasible. The Telegram notification logic lives primarily in telegram/ — adding the associated inbound tag(s) when building alert messages for a client would be a focused change.

Workaround in the meantime:
As you noted, the old approach of separate per-inbound client entries (e.g. sudo, sudo_R) conflicts with the new unique sub_id constraint. There is currently no clean workaround — this feature addition is the right path.

If you (or anyone else) wants to open a PR, the most impactful starting point would be the Telegram alert path, as it is more self-contained. Contributions are welcome!

<!-- gh-comment-id:4595572840 --> @github-actions[bot] commented on GitHub (Jun 1, 2026): Thank you for the well-detailed feature request, @Speert\! This is a valid gap introduced by the **Attached Inbounds** feature. When a single client email is linked to multiple inbounds, the Connections tab and Telegram Bot alerts lose the per-inbound context that was previously implicit (because each client mapped to exactly one inbound). A few notes on the scope and feasibility: **Web UI – Connections Tab** The active connections data comes from Xray-core's `/stats/` API (via `statsService`). The connection session data returned by Xray does **not** natively expose the inbound tag per-connection in a straightforward way today. Surfacing this would likely require correlating traffic stats with inbound tag data internally. This is technically non-trivial, but the request is reasonable. **Telegram Bot Alerts** Adding inbound context (e.g. `[inbound-tag]`) to traffic-limit and similar notifications appears more feasible. The Telegram notification logic lives primarily in `telegram/` — adding the associated inbound tag(s) when building alert messages for a client would be a focused change. **Workaround in the meantime:** As you noted, the old approach of separate per-inbound client entries (e.g. `sudo`, `sudo_R`) conflicts with the new unique `sub_id` constraint. There is currently no clean workaround — this feature addition is the right path. If you (or anyone else) wants to open a PR, the most impactful starting point would be the Telegram alert path, as it is more self-contained. Contributions are welcome\!
Author
Owner

@Speert commented on GitHub (Jun 1, 2026):

Thank you for the quick and detailed response!

I completely agree with your assessment. Starting with the Telegram bot alerts makes perfect sense since it's more self-contained and will immediately restore the lost visibility for day-to-day monitoring.

I'm glad we are on the same page regarding the workaround limitations. Hopefully, someone from the community (or myself, if I get a chance to dive into the Go code) can open a PR for the Telegram path soon.

I'll leave this issue open for tracking. Thanks again for your amazing work on maintaining 3x-ui!

<!-- gh-comment-id:4595600142 --> @Speert commented on GitHub (Jun 1, 2026): Thank you for the quick and detailed response! I completely agree with your assessment. Starting with the Telegram bot alerts makes perfect sense since it's more self-contained and will immediately restore the lost visibility for day-to-day monitoring. I'm glad we are on the same page regarding the workaround limitations. Hopefully, someone from the community (or myself, if I get a chance to dive into the Go code) can open a PR for the Telegram path soon. I'll leave this issue open for tracking. Thanks again for your amazing work on maintaining 3x-ui!
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#3314
No description provided.