mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #4594] [CLOSED] feat: add inbound traffic multiplier #5721
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#5721
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/4594
Author: @byang37
Created: 5/26/2026
Status: ❌ Closed
Base:
main← Head:pr/traffic-multiplier📝 Commits (1)
8c74a4efeat: add inbound traffic multiplier📊 Changes
22 files changed (+359 additions, -46 deletions)
View changed files
📝
database/model/model.go(+1 -0)📝
frontend/public/openapi.json(+2 -0)📝
frontend/src/models/dbinbound.ts(+3 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+2 -2)📝
frontend/src/pages/inbounds/InboundFormModal.tsx(+13 -0)📝
frontend/src/pages/inbounds/InboundsPage.tsx(+1 -0)📝
web/runtime/remote.go(+1 -0)📝
web/service/inbound.go(+169 -31)➕
web/service/inbound_traffic_multiplier_test.go(+141 -0)📝
web/translation/ar-EG.json(+2 -1)📝
web/translation/en-US.json(+2 -1)📝
web/translation/es-ES.json(+2 -1)📝
web/translation/fa-IR.json(+2 -1)📝
web/translation/id-ID.json(+2 -1)📝
web/translation/ja-JP.json(+2 -1)📝
web/translation/pt-BR.json(+2 -1)📝
web/translation/ru-RU.json(+2 -1)📝
web/translation/tr-TR.json(+2 -1)📝
web/translation/uk-UA.json(+2 -1)📝
web/translation/vi-VN.json(+2 -1)...and 2 more files
📄 Description
Summary
Add an inbound traffic multiplier setting to scale inbound upload/download traffic accounting. The multiplier is configurable from the Add/Edit Inbound UI and is applied to inbound and client traffic counters.
Why
This enables operators to bill or enforce traffic quotas using weighted traffic usage. For example, setting the multiplier to
2counts actual upload/download usage as double for the inbound and its clients.Type of change
Areas affected
How was this tested?
Added backend tests covering inbound/client traffic accounting with a traffic multiplier, including integer saturation behavior for large counters.
Tested locally with:
Also verified that the PR branch contains only the traffic multiplier feature changes and does not include unrelated install/update script changes.
Screenshots / recordings
Add Inbound Dialog Screenshot:

Edit Inbound Dialogs Screenshot:

Breaking changes
None.
Existing inbounds default to a multiplier of 1, preserving current traffic accounting behavior.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.