[GH-ISSUE #4785] [Feature]: Per-inbound traffic limits for clients with multiple attached inbounds #3319

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

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

Yes. The new Clients page with Attached Inbounds is useful for managing one client profile across multiple inbounds, but it changed an important workflow that was possible before.

Previously, clients could be added directly inside each inbound. This allowed an admin to create the same end user on multiple inbounds, keep the same subscription ID / sub ID, and assign different traffic limits per inbound.

Example:

  • same user subscription
  • multiple VLESS links inside that subscription
  • each link/inbound used for a different purpose
  • each inbound could have its own traffic quota

With the current Attached Inbounds model, the traffic limit is applied to the client globally across all attached inbounds. This means one client cannot have separate traffic limits for different attached inbounds.

Also, the old workaround is no longer possible because creating another client with the same sub ID is blocked. As a result, admins cannot keep one subscription ID while creating separate per-inbound client records with different limits.

Describe the solution you'd like

Please add support for per-inbound traffic limits for clients attached to multiple inbounds.

Possible UI behavior:
On the Clients page, when editing a client and selecting Attached Inbounds, each attached inbound could optionally have its own traffic settings:

  • traffic limit for this inbound
  • used traffic for this inbound
  • reset traffic for this inbound
  • expiration / enable status could stay global or optionally be per inbound

Example:
Client: user@example.com
Sub ID: user-sub-id

Attached inbounds:

  • VLESS Reality 443 — limit: 50 GB
  • VLESS gRPC 8443 — limit: 10 GB
  • VLESS XHTTP 2096 — limit: unlimited

The generated subscription should still include all selected links under the same client/subscription, but traffic accounting and limit enforcement should be able to work per inbound.

Alternative solution:
If full per-inbound limits are difficult to implement now, please allow creating multiple client records with the same sub ID, as long as they are attached to different inbounds. This would restore the previous workflow where an admin could manually create separate per-inbound client entries while keeping one subscription ID.

Suggested behavior:

  • duplicate sub ID should be allowed if inbound IDs are different
  • traffic limit should stay tied to the client-inbound pair
  • subscription generation should be able to include all matching clients with the same sub ID

Alternatives you've considered

The current workaround would be to create different clients with different sub IDs for each inbound, but this breaks the user experience because the end user no longer has one stable subscription.

Another workaround was to manually create the same client per inbound, but this is no longer possible because duplicate sub IDs are blocked.

A shared traffic quota across all attached inbounds is useful for some setups, but it does not cover cases where each inbound/server/link has a different purpose or different bandwidth budget.

Concrete use case

I have one end user with one subscription. This subscription contains several VLESS links from different inbounds.

Each inbound is used for a different purpose. For example:

  • main inbound: 50 GB/month
  • backup inbound: 5 GB/month
  • special-purpose inbound: 10 GB/month

The user should keep one subscription, but each inbound should have its own traffic limit. If the backup inbound reaches 5 GB, only that inbound/client-link should be limited or disabled, while the other inbounds should continue working according to their own limits.

This was possible with the old workflow where clients were managed directly inside each inbound. With the new Attached Inbounds model, the traffic limit is global for the client and cannot be separated by inbound.

Mockups, screenshots, or examples

Example layout in the client edit modal:

Attached Inbounds:

Inbound Enabled Traffic limit Used traffic
vless-reality-443 yes 50 GB 12 GB
vless-grpc-8443 yes 10 GB 2 GB
vless-xhttp-2096 yes unlimited 500 MB

Which parts of the panel would this affect?

Frontend (UI / panel pages), Subscription (share links / Clash / JSON), Statistics / traffic counters

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 @ergolyam on GitHub (Jun 1, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4785 ### Is your feature request related to a problem? Yes. The new Clients page with Attached Inbounds is useful for managing one client profile across multiple inbounds, but it changed an important workflow that was possible before. Previously, clients could be added directly inside each inbound. This allowed an admin to create the same end user on multiple inbounds, keep the same subscription ID / sub ID, and assign different traffic limits per inbound. Example: - same user subscription - multiple VLESS links inside that subscription - each link/inbound used for a different purpose - each inbound could have its own traffic quota With the current Attached Inbounds model, the traffic limit is applied to the client globally across all attached inbounds. This means one client cannot have separate traffic limits for different attached inbounds. Also, the old workaround is no longer possible because creating another client with the same sub ID is blocked. As a result, admins cannot keep one subscription ID while creating separate per-inbound client records with different limits. ### Describe the solution you'd like Please add support for per-inbound traffic limits for clients attached to multiple inbounds. Possible UI behavior: On the Clients page, when editing a client and selecting Attached Inbounds, each attached inbound could optionally have its own traffic settings: - traffic limit for this inbound - used traffic for this inbound - reset traffic for this inbound - expiration / enable status could stay global or optionally be per inbound Example: Client: [user@example.com](mailto:user@example.com) Sub ID: user-sub-id Attached inbounds: - VLESS Reality 443 — limit: 50 GB - VLESS gRPC 8443 — limit: 10 GB - VLESS XHTTP 2096 — limit: unlimited The generated subscription should still include all selected links under the same client/subscription, but traffic accounting and limit enforcement should be able to work per inbound. Alternative solution: If full per-inbound limits are difficult to implement now, please allow creating multiple client records with the same sub ID, as long as they are attached to different inbounds. This would restore the previous workflow where an admin could manually create separate per-inbound client entries while keeping one subscription ID. Suggested behavior: - duplicate sub ID should be allowed if inbound IDs are different - traffic limit should stay tied to the client-inbound pair - subscription generation should be able to include all matching clients with the same sub ID ### Alternatives you've considered The current workaround would be to create different clients with different sub IDs for each inbound, but this breaks the user experience because the end user no longer has one stable subscription. Another workaround was to manually create the same client per inbound, but this is no longer possible because duplicate sub IDs are blocked. A shared traffic quota across all attached inbounds is useful for some setups, but it does not cover cases where each inbound/server/link has a different purpose or different bandwidth budget. ### Concrete use case I have one end user with one subscription. This subscription contains several VLESS links from different inbounds. Each inbound is used for a different purpose. For example: - main inbound: 50 GB/month - backup inbound: 5 GB/month - special-purpose inbound: 10 GB/month The user should keep one subscription, but each inbound should have its own traffic limit. If the backup inbound reaches 5 GB, only that inbound/client-link should be limited or disabled, while the other inbounds should continue working according to their own limits. This was possible with the old workflow where clients were managed directly inside each inbound. With the new Attached Inbounds model, the traffic limit is global for the client and cannot be separated by inbound. ### Mockups, screenshots, or examples Example layout in the client edit modal: Attached Inbounds: | Inbound | Enabled | Traffic limit | Used traffic | | ----------------- | ------- | ------------- | ------------ | | vless-reality-443 | yes | 50 GB | 12 GB | | vless-grpc-8443 | yes | 10 GB | 2 GB | | vless-xhttp-2096 | yes | unlimited | 500 MB | ### Which parts of the panel would this affect? Frontend (UI / panel pages), Subscription (share links / Clash / JSON), Statistics / traffic counters ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [x] 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:31:37 +07:00
Author
Owner

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

Thank you for the detailed and well-structured feature request!

This is a real architectural limitation with the current Attached Inbounds model. Right now, traffic quota and usage are tracked at the client level (globally across all attached inbounds), so there is no per-inbound traffic accounting for a given client.

To implement per-inbound traffic limits, the data model would need to change — traffic limits, used traffic, and potentially enable/disable state would need to be stored per client–inbound pair rather than per client alone. This would touch the database schema, the backend traffic accounting logic, the Xray config generation (to disable only the specific inbound's client entry when its limit is reached), and the subscription output.

Your two proposed approaches are both valid angles:

  1. Per-inbound traffic settings in the Clients UI — the more complete solution, but requires changes across the full stack (DB, backend, frontend, subscription).
  2. Allow duplicate sub IDs across different inbounds — a lighter alternative that restores the old workflow with minimal schema changes, since each client record would still carry its own limit.

For now, the practical workaround is to use separate sub IDs per inbound (one subscription per purpose), though you've correctly noted that this breaks the single-subscription UX.

Leaving this open for the maintainers to consider. If you'd like to move toward a PR, the key files to look at are the client/traffic database model, service/inbound.go, and the subscription handler.

<!-- gh-comment-id:4597209551 --> @github-actions[bot] commented on GitHub (Jun 1, 2026): Thank you for the detailed and well-structured feature request\! This is a real architectural limitation with the current Attached Inbounds model. Right now, traffic quota and usage are tracked at the **client level** (globally across all attached inbounds), so there is no per-inbound traffic accounting for a given client. To implement per-inbound traffic limits, the data model would need to change — traffic limits, used traffic, and potentially enable/disable state would need to be stored per **client–inbound pair** rather than per client alone. This would touch the database schema, the backend traffic accounting logic, the Xray config generation (to disable only the specific inbound's client entry when its limit is reached), and the subscription output. Your two proposed approaches are both valid angles: 1. **Per-inbound traffic settings in the Clients UI** — the more complete solution, but requires changes across the full stack (DB, backend, frontend, subscription). 2. **Allow duplicate sub IDs across different inbounds** — a lighter alternative that restores the old workflow with minimal schema changes, since each client record would still carry its own limit. For now, the practical workaround is to use separate sub IDs per inbound (one subscription per purpose), though you've correctly noted that this breaks the single-subscription UX. Leaving this open for the maintainers to consider. If you'd like to move toward a PR, the key files to look at are the client/traffic database model, `service/inbound.go`, and the subscription handler.
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#3319
No description provided.