mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5068] [Feature]: [speed limit/ traffic shaping/ abuse guard] #3568
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#3568
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 @myxeni64b on GitHub (Jun 8, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5068
Is your feature request related to a problem?
The feature is so essentially and can be added to the amazing 3x-ui, I build a tiny useful tools:
Try this -> https://github.com/myxeni64b/xui-bw-guard
Good luck
Describe the solution you'd like
It can be integrated into the ecosystem easily, ready to contribute if you would like!
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
Other
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 8, 2026):
Thanks for the feature request and for building xui-bw-guard!
Current state of the codebase
Per-client speed/bandwidth limiting is not implemented in 3x-ui today. Confirmed by reading the source:
Clientmodel (database/model/model.go) has fields for traffic quota (TotalGB), IP limits (LimitIP), expiry, and reset period — but no speed/rate limit fields.xray/generates no per-user traffic-shaping directives.Why this is non-trivial to integrate
Xray-core itself does not expose a per-user bandwidth throttle in its config. Speed limiting at the OS level typically requires Linux
tc(traffic control) rules keyed on per-client identifiers — which is exactly the approach external tools like xui-bw-guard take. Integrating this natively into 3x-ui would require:Clientmodel and DB migrations.tcrules when clients are created, updated, or disabled — which means the panel process needs elevated network privileges.NET_ADMIN/NET_RAWcaps), multi-node setups, traffic reset cycles, etc.To move this forward
If you'd like to open a PR, it would help to clarify a few things first:
tc qdisc,iptables, eBPF)?tcrules are absent?A concrete design proposal (even a short one in the PR description) would help maintainers evaluate the approach before implementation work begins.