mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6803] [MERGED] feat(sub): make the host "Mihomo X25519" switch drop ML-KEM #6459
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#6459
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/6803
Author: @Toximiner
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @MHSanaei
Base:
main← Head:feat/host-mihomo-x25519📝 Commits (6)
adad6affix(sub): carry a reality host's fingerprint into Clash and JSON3660650feat(sub): make the host "Mihomo X25519" switch drop ML-KEM0aaba17fix(sub): give every host endpoint its own deep copy of the stream143a4d9feat(database): clear Mihomo X25519 switches saved while they were ignored0726defMerge remote-tracking branch 'origin/main' into pr/68038265315Merge remote-tracking branch 'origin/main' into pr/6803📊 Changes
24 files changed (+369 additions, -25 deletions)
View changed files
📝
docs/content/docs/en/config/reality.mdx(+5 -3)📝
docs/content/docs/fa/config/reality.mdx(+9 -3)📝
docs/content/docs/ru/config/reality.mdx(+6 -4)📝
docs/content/docs/zh/config/reality.mdx(+1 -1)📝
frontend/src/pages/hosts/HostFormModal.tsx(+1 -0)📝
internal/database/db.go(+18 -1)📝
internal/database/host_migration_test.go(+42 -0)📝
internal/sub/clash_service.go(+7 -0)📝
internal/sub/host_sub.go(+16 -0)📝
internal/sub/host_sub_test.go(+224 -0)📝
internal/sub/service.go(+27 -13)📝
internal/web/translation/ar-EG.json(+1 -0)📝
internal/web/translation/en-US.json(+1 -0)📝
internal/web/translation/es-ES.json(+1 -0)📝
internal/web/translation/fa-IR.json(+1 -0)📝
internal/web/translation/id-ID.json(+1 -0)📝
internal/web/translation/ja-JP.json(+1 -0)📝
internal/web/translation/pt-BR.json(+1 -0)📝
internal/web/translation/ru-RU.json(+1 -0)📝
internal/web/translation/tr-TR.json(+1 -0)...and 4 more files
📄 Description
Summary
Makes the existing per-host Mihomo X25519 switch actually do something: a host with it on gets
support-x25519mlkem768: falsein its Clash/Mihomo proxy and no ML-KEM hint in itsvless://link. Also fixes a reality host's fingerprint not reaching the Clash and JSON outputs, stops hosts of one inbound from leaking a blank-field override (SNI, fingerprint, Host header, path) into each other by deep-copying the stream per endpoint, and adds a one-time migration that resets switches saved while they had no effect.Why
mihomoX25519has been stored on hosts since #5409, but no renderer ever read it, so the switch had no effect.support-x25519mlkem768: truefor every REALITY proxy. Its own Compatibility note says servers that should not get ML-KEM "need a per-node client override setting the option tofalse", but no such override exists.chromewithout ML-KEM went 20/20 andchromewith ML-KEM 3/20. Today the only way to get the X25519 hello on such a network is to stay on 3x-ui 3.7.x, because 3.8.0+ hard-codes the flag.applyHostStreamOverridescopied a reality host's SNI into the client stream but not its fingerprint, so one host producedfp=firefoxinvless://andchromein Clash/JSON. The bot review on #6451 flagged this as pre-existing.Refs #5409, #6451, #6712.
Type of change
Areas affected
How was this tested?
New tests in
internal/sub/host_sub_test.go. Each one failed onmainfor the reported reason before the fix:TestSub_HostRealityFingerprintJSONAndClash: a reality host withfirefoxyieldsfingerprint: firefoxin JSON andclient-fingerprint: firefoxin Clash (waschrome).TestSub_HostMihomoX25519Clash: two hosts on one reality inbound. The default host keepssupport-x25519mlkem768: true, the host with the switch getsfalse.TestSub_HostMihomoX25519RawLink: same setup, the default host'svless://keepssupport-x25519mlkem768=trueand the switched host's link has no hint.TestSub_HostBlankOverridesDoNotLeakBetweenHosts: two hosts on one inbound, the first sets an override and the second leaves it blank. The second must get the inbound's value in Clash and JSON. Cases: reality fingerprint + SNI, and ws Host + path.TestMigrate_PreexistingMihomoX25519IsResetOnce: a row switched on before the upgrade is reset once, and a switch set after the upgrade survives a restart.Also run:
go test ./... -shuffle=on -count=1: green.golangci-lint run(v2.14.0): 0 issues.npm run typecheck,npm run lint, allunitvitest projects (1363 tests, includingi18n-dead-keys), andnpm run buildpass.support-x25519mlkem768: falseand the othertrue, and both carry the host'sfirefox. Raw: only the non-switched host's link hassupport-x25519mlkem768=true.Not run locally: the Storybook/Playwright test project and the full
make verify. The only frontend change is a tooltip on an existing field.Screenshots / recordings
Host form → Advanced → Clash (mihomo), with the new tooltip:
Breaking changes
None. The switch defaults to off. A one-time migration (
HostMihomoX25519Reset) clears switches saved while they had no effect, so every existing subscription renders exactly as before; switches set after the upgrade persist. No schema change: the column already exists.Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.The code in this PR was written with the help of an AI assistant (Claude). The DPI diagnosis and the checks above come from my own deployment.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.