[PR #6712] [MERGED] fix(sub): carry REALITY ML-KEM hint in VLESS links #6427

Closed
opened 2026-11-02 04:08:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6712
Author: @libmur-dev
Created: 10/1/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @MHSanaei

Base: main ← Head: fix/vless-share-mlkem-hint


📝 Commits (5)

  • 3ed820b fix(sub): carry REALITY ML-KEM hint in VLESS links
  • 093451f fix(link): accept REALITY ML-KEM boolean aliases
  • bf57a7a test(frontend): isolate Happ preset notifications
  • 84de7ad Merge origin/main into pr/6712
  • 1a5100e fix(link): keep the ML-KEM hint out of Xray REALITY settings

📊 Changes

19 files changed (+106 additions, -16 deletions)

View changed files

📝 docs/components/tools/reality-config-generator.tsx (+1 -0)
📝 docs/content/docs/en/config/reality.mdx (+5 -4)
📝 docs/content/docs/fa/config/reality.mdx (+3 -1)
📝 docs/content/docs/ru/config/reality.mdx (+6 -5)
📝 docs/content/docs/zh/config/reality.mdx (+1 -1)
📝 docs/lib/xray/reality.test.ts (+2 -0)
📝 docs/lib/xray/reality.ts (+2 -0)
📝 docs/lib/xray/subscription.test.ts (+9 -0)
📝 docs/lib/xray/subscription.ts (+4 -0)
📝 frontend/src/lib/xray/inbound-link.ts (+1 -0)
📝 frontend/src/test/__snapshots__/inbound-link.test.ts.snap (+2 -2)
📝 frontend/src/test/happ-settings-presets.test.tsx (+3 -0)
📝 frontend/src/test/inbound-link.test.ts (+16 -0)
📝 frontend/src/test/outbound-link-parser.test.ts (+10 -0)
📝 internal/sub/endpoint.go (+9 -1)
📝 internal/sub/host_sub_test.go (+7 -1)
📝 internal/sub/service.go (+1 -0)
📝 internal/sub/service_sharelink_test.go (+1 -0)
📝 internal/util/link/outbound_helpers_test.go (+23 -1)

📄 Description

English

Fixes #6555.

Problem

3x-ui already enables reality-opts.support-x25519mlkem768 in Clash/Mihomo subscriptions, but raw VLESS REALITY links did not carry the equivalent URI hint. As a result, importing the same node through a vless:// link could fail against Xray-core 26.9.8+ even though the Clash subscription worked.

Mihomo parses this VLESS URI parameter in common/convert/v.go, merged in MetaCubeX/mihomo#3199.

Changes

  • emit support-x25519mlkem768=true from both backend and frontend VLESS REALITY link generators;
  • strip the hint when a host override changes REALITY to TLS or no security;
  • parse and preserve the hint in both Go and TypeScript link import paths, including Mihomo-compatible boolean aliases such as true and 1;
  • add an outbound REALITY switch, defaulting to false for manually-created and legacy configurations;
  • add the UI label to all 13 locales;
  • update fixtures, snapshots, documentation generators, tests, and the REALITY guides in all four documented languages.

The generated share-link default intentionally matches the existing Clash subscription behavior. The outbound toggle remains explicit so users targeting older REALITY servers can keep it disabled.

Verification

  • go test -shuffle=on -count=1 ./...
  • go build ./...
  • golangci-lint run — 0 issues
  • GitHub Actions: Go tests, race, fuzz smoke, PostgreSQL durability, codegen, golangci, govulncheck, and docs build passed
  • frontend CI: all 176 files / 1759 tests passed, followed by successful production and Storybook builds
  • local frontend unit tests — 1327 passed; component tests — 337 passed
  • frontend typecheck, lint, format check, and generated Zod/OpenAPI freshness check
  • docs typecheck, lint, format check, tests — 106 passed, and production build — 269 static pages

The frontend job is reported as failed only because its final npm audit --omit=dev --audit-level=high step finds the pre-existing brace-expansion and DOMPurify advisories. The current upstream main run fails at the same Audit step; dependency upgrades are intentionally not bundled into this fix.

The test-only Happ notification stub prevents an existing global Ant Design toast root from surviving jsdom teardown under the full parallel suite. It does not change production behavior.

Русский

Закрывает #6555.

Проблема

3x-ui уже включает reality-opts.support-x25519mlkem768 в подписках Clash/Mihomo, но обычные ссылки VLESS REALITY не передавали эквивалентную подсказку URI. Поэтому импорт одного и того же узла через vless:// мог не подключаться к Xray-core 26.9.8+, хотя Clash-подписка работала.

Mihomo разбирает этот параметр VLESS URI в common/convert/v.go; поддержка добавлена в MetaCubeX/mihomo#3199.

Изменения

  • support-x25519mlkem768=true добавляется серверным и фронтенд-генераторами ссылок VLESS REALITY;
  • параметр удаляется, если переопределение хоста меняет REALITY на TLS или отсутствие защиты;
  • Go- и TypeScript-парсеры импортируют и сохраняют параметр, включая совместимые с Mihomo boolean-значения true и 1;
  • в форме исходящего REALITY добавлен переключатель со значением false по умолчанию для ручных и старых конфигураций;
  • подпись переключателя добавлена во все 13 локалей;
  • обновлены fixtures, snapshots, генераторы документации, тесты и руководства REALITY на четырёх языках.

Значение в генерируемой ссылке намеренно совпадает с текущим поведением Clash-подписки. Переключатель исходящего соединения остаётся явным, чтобы для старых REALITY-серверов параметр можно было не включать.

Проверка

  • go test -shuffle=on -count=1 ./...
  • go build ./...
  • golangci-lint run — 0 замечаний
  • GitHub Actions: прошли Go tests, race, fuzz smoke, PostgreSQL durability, codegen, golangci, govulncheck и сборка документации
  • frontend CI: прошли все 176 файлов / 1759 тестов, production build и сборка Storybook
  • локально: 1327 unit-тестов и 337 component-тестов фронтенда
  • frontend typecheck, lint, format check и проверка актуальности сгенерированных Zod/OpenAPI-файлов
  • typecheck, lint, format check и тесты документации — 106 успешно; production build — 269 статических страниц

Frontend-job отмечен как failed только потому, что его последний шаг npm audit --omit=dev --audit-level=high находит уже существующие advisory для brace-expansion и DOMPurify. Текущий запуск upstream main падает на том же шаге Audit; обновление зависимостей намеренно не включено в этот fix.

Тестовая подмена уведомления Happ не позволяет существующему глобальному toast-root Ant Design пережить teardown jsdom в полном параллельном наборе. Production-поведение не изменяется.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6712 **Author:** [@libmur-dev](https://github.com/libmur-dev) **Created:** 10/1/2026 **Status:** ✅ Merged **Merged:** 10/2/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/vless-share-mlkem-hint` --- ### 📝 Commits (5) - [`3ed820b`](https://github.com/MHSanaei/3x-ui/commit/3ed820b9a32491d039c6e8f6fad6e4c790929c3d) fix(sub): carry REALITY ML-KEM hint in VLESS links - [`093451f`](https://github.com/MHSanaei/3x-ui/commit/093451f5578495c3ac7816112476307b218d69ec) fix(link): accept REALITY ML-KEM boolean aliases - [`bf57a7a`](https://github.com/MHSanaei/3x-ui/commit/bf57a7a1e883fd38aa017149a604b87b91673f54) test(frontend): isolate Happ preset notifications - [`84de7ad`](https://github.com/MHSanaei/3x-ui/commit/84de7add9a9e38b87717ad62b0de320cf7c7991f) Merge origin/main into pr/6712 - [`1a5100e`](https://github.com/MHSanaei/3x-ui/commit/1a5100ea166361cc2a01d8f245d616fb18baa0dd) fix(link): keep the ML-KEM hint out of Xray REALITY settings ### 📊 Changes **19 files changed** (+106 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/components/tools/reality-config-generator.tsx` (+1 -0) 📝 `docs/content/docs/en/config/reality.mdx` (+5 -4) 📝 `docs/content/docs/fa/config/reality.mdx` (+3 -1) 📝 `docs/content/docs/ru/config/reality.mdx` (+6 -5) 📝 `docs/content/docs/zh/config/reality.mdx` (+1 -1) 📝 `docs/lib/xray/reality.test.ts` (+2 -0) 📝 `docs/lib/xray/reality.ts` (+2 -0) 📝 `docs/lib/xray/subscription.test.ts` (+9 -0) 📝 `docs/lib/xray/subscription.ts` (+4 -0) 📝 `frontend/src/lib/xray/inbound-link.ts` (+1 -0) 📝 `frontend/src/test/__snapshots__/inbound-link.test.ts.snap` (+2 -2) 📝 `frontend/src/test/happ-settings-presets.test.tsx` (+3 -0) 📝 `frontend/src/test/inbound-link.test.ts` (+16 -0) 📝 `frontend/src/test/outbound-link-parser.test.ts` (+10 -0) 📝 `internal/sub/endpoint.go` (+9 -1) 📝 `internal/sub/host_sub_test.go` (+7 -1) 📝 `internal/sub/service.go` (+1 -0) 📝 `internal/sub/service_sharelink_test.go` (+1 -0) 📝 `internal/util/link/outbound_helpers_test.go` (+23 -1) </details> ### 📄 Description ## English Fixes #6555. ### Problem 3x-ui already enables `reality-opts.support-x25519mlkem768` in Clash/Mihomo subscriptions, but raw VLESS REALITY links did not carry the equivalent URI hint. As a result, importing the same node through a `vless://` link could fail against Xray-core 26.9.8+ even though the Clash subscription worked. Mihomo parses this VLESS URI parameter in [`common/convert/v.go`](https://github.com/MetaCubeX/mihomo/blob/518c7036dfc85248d304181993664e4fb2a65bcb/common/convert/v.go#L47-L56), merged in MetaCubeX/mihomo#3199. ### Changes - emit `support-x25519mlkem768=true` from both backend and frontend VLESS REALITY link generators; - strip the hint when a host override changes REALITY to TLS or no security; - parse and preserve the hint in both Go and TypeScript link import paths, including Mihomo-compatible boolean aliases such as `true` and `1`; - add an outbound REALITY switch, defaulting to `false` for manually-created and legacy configurations; - add the UI label to all 13 locales; - update fixtures, snapshots, documentation generators, tests, and the REALITY guides in all four documented languages. The generated share-link default intentionally matches the existing Clash subscription behavior. The outbound toggle remains explicit so users targeting older REALITY servers can keep it disabled. ### Verification - `go test -shuffle=on -count=1 ./...` - `go build ./...` - `golangci-lint run` — 0 issues - GitHub Actions: Go tests, race, fuzz smoke, PostgreSQL durability, codegen, golangci, govulncheck, and docs build passed - frontend CI: all 176 files / 1759 tests passed, followed by successful production and Storybook builds - local frontend unit tests — 1327 passed; component tests — 337 passed - frontend typecheck, lint, format check, and generated Zod/OpenAPI freshness check - docs typecheck, lint, format check, tests — 106 passed, and production build — 269 static pages The frontend job is reported as failed only because its final `npm audit --omit=dev --audit-level=high` step finds the pre-existing `brace-expansion` and DOMPurify advisories. The [current upstream `main` run](https://github.com/MHSanaei/3x-ui/actions/runs/36719311473) fails at the same Audit step; dependency upgrades are intentionally not bundled into this fix. The test-only Happ notification stub prevents an existing global Ant Design toast root from surviving jsdom teardown under the full parallel suite. It does not change production behavior. ## Русский Закрывает #6555. ### Проблема 3x-ui уже включает `reality-opts.support-x25519mlkem768` в подписках Clash/Mihomo, но обычные ссылки VLESS REALITY не передавали эквивалентную подсказку URI. Поэтому импорт одного и того же узла через `vless://` мог не подключаться к Xray-core 26.9.8+, хотя Clash-подписка работала. Mihomo разбирает этот параметр VLESS URI в [`common/convert/v.go`](https://github.com/MetaCubeX/mihomo/blob/518c7036dfc85248d304181993664e4fb2a65bcb/common/convert/v.go#L47-L56); поддержка добавлена в MetaCubeX/mihomo#3199. ### Изменения - `support-x25519mlkem768=true` добавляется серверным и фронтенд-генераторами ссылок VLESS REALITY; - параметр удаляется, если переопределение хоста меняет REALITY на TLS или отсутствие защиты; - Go- и TypeScript-парсеры импортируют и сохраняют параметр, включая совместимые с Mihomo boolean-значения `true` и `1`; - в форме исходящего REALITY добавлен переключатель со значением `false` по умолчанию для ручных и старых конфигураций; - подпись переключателя добавлена во все 13 локалей; - обновлены fixtures, snapshots, генераторы документации, тесты и руководства REALITY на четырёх языках. Значение в генерируемой ссылке намеренно совпадает с текущим поведением Clash-подписки. Переключатель исходящего соединения остаётся явным, чтобы для старых REALITY-серверов параметр можно было не включать. ### Проверка - `go test -shuffle=on -count=1 ./...` - `go build ./...` - `golangci-lint run` — 0 замечаний - GitHub Actions: прошли Go tests, race, fuzz smoke, PostgreSQL durability, codegen, golangci, govulncheck и сборка документации - frontend CI: прошли все 176 файлов / 1759 тестов, production build и сборка Storybook - локально: 1327 unit-тестов и 337 component-тестов фронтенда - frontend typecheck, lint, format check и проверка актуальности сгенерированных Zod/OpenAPI-файлов - typecheck, lint, format check и тесты документации — 106 успешно; production build — 269 статических страниц Frontend-job отмечен как failed только потому, что его последний шаг `npm audit --omit=dev --audit-level=high` находит уже существующие advisory для `brace-expansion` и DOMPurify. [Текущий запуск upstream `main`](https://github.com/MHSanaei/3x-ui/actions/runs/36719311473) падает на том же шаге Audit; обновление зависимостей намеренно не включено в этот fix. Тестовая подмена уведомления Happ не позволяет существующему глобальному toast-root Ant Design пережить teardown jsdom в полном параллельном наборе. Production-поведение не изменяется. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:08:42 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6427
No description provided.