mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6694] [MERGED] fix(sub): keep the spider settings in a reality spiderX seed's query #6416
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#6416
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/6694
Author: @FZ1010
Created: 9/30/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @MHSanaei
Base:
main← Head:fix/spiderx-keep-query📝 Commits (2)
1601524fix(sub): keep the spider settings in a reality spiderX seed's query7442022docs(sub): keep the deriveSpiderX comments within two lines📊 Changes
4 files changed (+40 additions, -7 deletions)
View changed files
📝
frontend/src/lib/xray/spider-x.ts(+6 -4)📝
frontend/src/test/spider-x.test.ts(+6 -0)📝
internal/sub/service.go(+7 -3)📝
internal/sub/service_sharelink_test.go(+21 -0)📄 Description
Summary
deriveSpiderXnow keeps the seed's query after the per-client path, so the spider settings Xray reads there (p,c,t,i,r) reach share links and JSON subscriptions. The frontend mirror is updated to match.Why
Fixes #6693.
Xray's REALITY client reads
p/c/t/i/rfrom the spiderX query as its spider's own settings and strips them before browsing (infra/conf/transport_security.go). The per-client derivation from #5718 hashed the whole seed into a bare/path, so a query set on the inbound never reached any client, and the spider always ran with defaults.The hash input is unchanged: every existing client's
spxstays exactly the same, and only seeds that carry a query gain it. Go'surl.Values.Encodeand the frontend'sURLSearchParamsescape the?/&, so the query stays insidespxin share links.Type of change
Areas affected
How was this tested?
TestDeriveSpiderXMatchesFrontendVectorsandfrontend/src/test/spider-x.test.ts.TestGenVlessLink_RealitySpiderXKeepsSpiderSettings: the link'sspxdecodes to/<hash>?p=…&r=…, andp/rdon't leak into the link's own query.main, green here (screenshot below).go test -shuffle=on ./internal/sub/...andgo vetpass.vitest(spider-x),oxlint,oxfmt --checkandtsc --noEmitpass.GetJsononmainand on this branch. The config with the kept query loads with Xray-core 26.7.28 and 26.9.9 (Configuration OK.).Screenshots / recordings
The same inbound (spiderX
/?p=40-400&c=1-4&t=1-3&i=1500-6000&r=500-2000) onmainvs this branch: JSON sub, share link, andxray run -test:The new tests on
main(red), then on this branch (green):Breaking changes
None. Seeds without a query produce the same
spxas before.Checklist
go build ./...and the test suite pass locally. (go build ./...needs the frontenddistembed; the changed package builds, vets and tests clean.)npm run lint,npm run typecheck, andnpm run buildpass. (lint, format check and typecheck run;buildnot run, since the change is one pure function.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.