mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #2933] Add accumulative traffic (flow) for multiple config of the same client #1958
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#1958
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 @emranovin on GitHub (Apr 22, 2025).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/2933
Is your feature request related to a problem? Please describe.
There is a scenario in which I want to assign a total of 100 GB to a user, but I want to give him multiple configs (like ss, vless, vmess, etc). With the same subscription link, this can happen. But if I create 4 different configs, I have to set 25 GB for each config, and user have to change their config after consuming each 25 GB, which is unfortunate.
If I assign 100 GB to each config, there would be 400 GB, and it's unfortunate for me as a server owner.
Describe the solution you'd like
As a user, I'd rather consume any of the SS or VLESS config by choice, but all of them can have 100 GB total flow. It would be like cumulative traffic. It doesn't matter if I consume from any of the configs. After all, they are all bound to the same 100 GB account. For example, I can use vless config to use all 100 GB or use Shadowsocks to use all 100 GB.
To elaborate more, as a user, I can consume 20 GB with the SS config, and my remaining flow would be 80 GB. I can switch to the VMESS config and consume the remaining 80 GB with this config. I have an arbitrary choice to use any of the configs that best suit my network, and my overall usage would not exceed 100 GB.
@AliAkhgar commented on GitHub (May 10, 2025):
I believe this goes beyond the capabilities of the XrayCore itself, not even mentioning 3X-UI. (as XrayCore unique identifier for users seems to be the email field, correct me if I'm wrong.)
To solve this issue, you'll need to aggregate user's info on a central server with the help of the feature External Traffic Inform, even allowing the user to have access to multiple different instances of 3X-UI on multiple servers.
@emranovin commented on GitHub (May 10, 2025):
I'm not sure if I've got your point right but I didn't mean to get accumulative traffic between server instancces. I request this feature on a single server with multiple configurations.
Now I had to define only one configuration at a time cause if I define 2 config user will get 2 times traffic which is unfortunate.
@AliAkhgar commented on GitHub (May 10, 2025):
You are correct. AFAIK, aggregating on a single server is not possible too.
If we could define a client with the same email on multiple inbounds, we might be able to do that, but we can not do that either.
So in this case, we still need a central server even if we are servicing all clients only on a single 3X-UI instance.
We do have your condition which we register clients on a single 3X-UI, each client in 2 or 3 inbounds. Yet, we can not aggregate them too. External Inform Traffic seems to be the only option to go. Which has a bug as we speak.
@emranovin commented on GitHub (May 13, 2025):
Thanks for the elaboration.
At the moment we have a feature which if admin set the same id for subscription link user will have multiple configurations with same link. Can't we use some sort of logic as like as this to recognize which user is which and define user trafic in a single source of truth in the db?
This is not my expertise area and I'm just speculating out of the blue.
@AliAkhgar commented on GitHub (May 13, 2025):
This can be possible with some extra coding and can be done but goes beyond the scope of 3X-UI.
I have already achieved it with the feature External Traffic Inform. A separate server as controller is required.