mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5506] [MERGED] feat(xhttp): support sessionID* rename + sessionIDTable/Length (xray v26.6.22) #5906
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#5906
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/5506
Author: @rqzbeh
Created: 6/23/2026
Status: ✅ Merged
Merged: 6/23/2026
Merged by: @MHSanaei
Base:
main← Head:feat/xhttp-sessionid-v26.6.22📝 Commits (4)
71a6844feat(xhttp): support sessionID* rename + sessionIDTable/Length (xray v26.6.22)13a446etest(xhttp): add Session ID Table to inbound form-blocks snapshot1fdafa2fix(xhttp): migrate legacy session keys in the running xray config3ef6171fix(xray): avoid summed-capacity allocation in mergeSubscriptionOutbounds📊 Changes
31 files changed (+498 additions, -45 deletions)
View changed files
📝
frontend/src/lib/xray/inbound-link.ts(+4 -2)📝
frontend/src/lib/xray/outbound-link-parser.ts(+23 -3)📝
frontend/src/lib/xray/stream-wire-normalize.ts(+4 -2)➕
frontend/src/lib/xray/xhttp-session-id.ts(+34 -0)📝
frontend/src/pages/inbounds/form/InboundFormModal.tsx(+1 -1)📝
frontend/src/pages/inbounds/form/transport/xhttp.tsx(+30 -6)📝
frontend/src/pages/xray/outbounds/transport/xhttp.tsx(+36 -4)📝
frontend/src/schemas/protocols/stream/xhttp.ts(+36 -4)📝
frontend/src/test/__snapshots__/inbound-form-blocks.test.tsx.snap(+1 -0)📝
frontend/src/test/__snapshots__/stream.test.ts.snap(+16 -8)📝
frontend/src/test/golden/fixtures/stream/xhttp-extra-placement.json(+2 -2)📝
frontend/src/test/outbound-link-parser.test.ts(+8 -3)➕
frontend/src/test/xhttp-session-id.test.ts(+54 -0)📝
internal/sub/clash_service.go(+19 -2)📝
internal/sub/clash_service_test.go(+14 -6)📝
internal/sub/service.go(+15 -1)📝
internal/web/service/xray.go(+68 -1)➕
internal/web/service/xray_xhttp_session_test.go(+81 -0)📝
internal/web/translation/ar-EG.json(+4 -0)📝
internal/web/translation/en-US.json(+4 -0)...and 11 more files
📄 Description
Summary
Bring the panel's XHTTP transport in line with xray-core v26.6.22 (PR #6258): rename the session config keys and add the two new session-ID fields.
Why
xray-core v26.6.22 renamed
sessionPlacement/sessionKeytosessionIDPlacement/sessionIDKey(the engine keeps no fallback for the old names) and added:sessionIDTable— encoding charset: a predefined name (ALPHABET,Alphabet,BASE36,Base62,HEX,alphabet,base36,hex,number) or a literal ASCII string.sessionIDLength— session-ID length range (e.g.16-32); lower bound must be > 0. xray validates that the resulting ID space exceeds ~2.1 billion possibilities.Until this change, any inbound configured with a non-default
sessionPlacementis silently ignored by the bundled engine.Two sibling v26.6.22 XHTTP commits need no panel change and are covered by the core bump alone: #6332 (XHTTP/3 closes QUIC/UDP) and #6320 (udpHop honors the existing
dialerProxy).Type of change
Areas affected
How was this tested?
sessionPlacement/sessionKeylift onto the renamed keys and the legacy keys are dropped).typecheck+lintpass; snapshot and golden fixtures updated; addedxhttp-session-id.test.ts(migration + validators) and legacy-alias coverage inoutbound-link-parser.test.ts.go build ./...and the fullgo test -shuffle=on -count=1 ./...suite pass; updatedclash_service_test.gofor the renamed/new keys.frontend/src/generated+openapi.jsonunchanged — XHTTP settings are not modeled there).Manual: create an XHTTP inbound, set Session Placement = cookie, Session ID Table =
Base62, Session ID Length =16-32, save → generated config emitssessionIDPlacement/sessionIDKey/sessionIDTable/sessionIDLengthand no legacysession*keys. A pre-upgrade inbound withsessionKeyshows the value under the renamed field and re-saves with the new key.Breaking changes
The wire keys
sessionPlacement/sessionKeyare renamed tosessionIDPlacement/sessionIDKeyto match xray-core. Migration is automatic: stored inbound/outbound configs are lifted onto the new keys on load (Zod preprocess), the subscription and Clash builders fall back to the legacy keys for not-yet-resaved inbounds, and old share links carryingsessionKey/sessionPlacementare still imported. No user action required.Checklist
go build ./...and the test suite pass locally.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.