mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
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#5965
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/5699
Author: @FZ1010
Created: 6/30/2026
Status: ❌ Closed
Base:
main← Head:feat/per-inbound-flow-override📝 Commits (6)
c57944cfeat(clients): writable per-(client,inbound) XTLS flow override87dfe06fix(clients): validate flow + register route; drop redundant flow_override write2a95c1efeat(clients): make per-inbound flow override durable via flowLockc5c9431feat(clients): add per-inbound flow override UI to the client info modal7de957fMerge origin/main into feat/per-inbound-flow-override310ad41feat(inbounds): move per-client flow override into the inbound edit form📊 Changes
14 files changed (+494 additions, -4 deletions)
View changed files
📝
frontend/public/openapi.json(+61 -0)📝
frontend/src/generated/examples.ts(+1 -0)📝
frontend/src/generated/schemas.ts(+3 -0)📝
frontend/src/generated/types.ts(+1 -0)📝
frontend/src/generated/zod.ts(+1 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+12 -0)📝
frontend/src/pages/inbounds/form/InboundFormModal.tsx(+58 -1)📝
internal/database/model/model.go(+3 -2)📝
internal/web/controller/client.go(+25 -0)📝
internal/web/service/client_crud.go(+14 -1)➕
internal/web/service/client_flow_override.go(+52 -0)➕
internal/web/service/client_flow_override_durability_test.go(+224 -0)➕
internal/web/service/client_flow_override_test.go(+33 -0)📝
internal/web/service/inbound_flow_restore.go(+6 -0)📄 Description
Closes #5689.
Problem
A VLESS client attached to multiple inbounds carries a single client-level
flow. The panel clamps that flow onto every flow-capable inbound the client is on, so you cannot keepxtls-rprx-visionon a Reality inbound while turning it off on a tunneled XHTTP + VLESS-encryption inbound for the same client. Vision over a CDN/tunneled transport is frequently undesirable, but today it is all-or-nothing.Approach — writable per-(client,inbound) flow override
A new endpoint sets or clears the XTLS flow for one client on one inbound, independently of its flow on sibling inbounds, with a panel control to drive it.
Backend
POST /panel/api/clients/:email/flow→SetInboundClientFlow(inboundId, email, flow)writes the chosen flow into just that inbound's settings. It validates against the recognized-flow allowlist and the inbound's capability (clearing —""/none— is always allowed; an unknown value or a flow on a non-capable transport is rejected).flowLockmarker. Without it,restoreVisionFlowForEligibleInbound(runs on every boot and inbound edit) and the whole-client editor (ClientService.Update) both re-homogenize a client's flow across its inbounds and would undo a deliberate clear.flowLockis stored in the inbound's settings JSON (so it survivesSyncInbound, which rebuildsflow_overridefrom settings) and is never sent to Xray (GetXrayConfigrebuilds clean client entries, and Xray ignores unknown client fields).SetInboundClientFlowpins the written client; the restore pass andUpdateskip/preserve flow-locked entries.Frontend
DisableFlowswitch lives. It only renders when editing an existing inbound that is currently flow-capable (canEnableTlsFlow) and has at least one attached client. Each row lists a client's email with aSelect(xtls-rprx-vision/none) that posts to the endpoint above and refreshes the inbound list in place — no page reload, modal stays open so multiple clients can be adjusted in one sitting.Tests
MigrationRestoreVisionFlowand a whole-client edit (a regression that fails without theflowLock+Updatechanges);restoreVisionFlowForEligibleInboundskips a flow-locked client (with an un-pinned control proving the test catches a regression);SetInboundClientFlowvalidation paths (unknown flow / non-capable inbound / unknown client / valid pin).make verify— ✅verify: OKRan the full CI-mirroring gate locally (CGO sqlite via MinGW; golangci-lint built for go 1.26.4):
gen-checklint(golangci-lint + eslint)typecheck(tsc --noEmit)test—go test -shuffle=on ./...test— frontend vitestbuild(Vite bundles +go build ./...)No
//line comments in committed Go/TS, per the repo guidelines.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.