[PR #4912] [MERGED] feat(sub): modern xray JSON format with unified finalmask editor #5746

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4912
Author: @biohazardous-man
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @MHSanaei

Base: main ← Head: main


📝 Commits (4)

  • f4a0712 feat(sub): add finalmask support to JSON subscriptions
  • 08fca9e feat(sub): modern xray JSON format with unified finalmask editor
  • d8e9d9b Merge branch 'main' into main
  • 665557b fix

📊 Changes

27 files changed (+352 additions, -277 deletions)

View changed files

📝 frontend/public/openapi.json (+1 -1)
📝 frontend/src/generated/types.ts (+2 -4)
📝 frontend/src/generated/zod.ts (+2 -4)
📝 frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx (+15 -21)
📝 frontend/src/models/setting.ts (+1 -2)
➕ frontend/src/pages/settings/SubJsonFinalMaskForm.tsx (+55 -0)
📝 frontend/src/pages/settings/SubscriptionFormatsTab.tsx (+9 -147)
📝 frontend/src/schemas/setting.ts (+1 -2)
📝 sub/sub.go (+6 -11)
📝 sub/subController.go (+2 -3)
📝 sub/subJsonService.go (+78 -70)
➕ sub/subJsonService_test.go (+148 -0)
📝 web/entity/entity.go (+1 -2)
📝 web/service/setting.go (+5 -10)
📝 web/translation/ar-EG.json (+2 -0)
📝 web/translation/en-US.json (+2 -0)
📝 web/translation/es-ES.json (+2 -0)
📝 web/translation/fa-IR.json (+2 -0)
📝 web/translation/id-ID.json (+2 -0)
📝 web/translation/ja-JP.json (+2 -0)

...and 7 more files

📄 Description

Summary

Add finalmask noise / fragment to 3x-ui JSON subscription endpoint.

Why

Right now only place where fragment or noise is displayed after setting it up in 3x-ui is outbound.
However, modern xray expects fragment and noise filters in the finalmask (see https://xtls.github.io/en/config/transports/finalmask.html#fragment)

Because of that modern clients don't see fragment/noise setting and can't apply it

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

Opened subscription JSON endpoint, now fragmentation is shown both in outbound and finalmask.
Ran unit test, it passed.

Breaking changes

If someone enables fragmentation it may need for clients to update their xray client version to more modern one.
Sadly if old version of Xray core finds fragment in finalmask, it just can't process this config. But since this is opt-in feature, I wouldn't consider that breaking change.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 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/4912 **Author:** [@biohazardous-man](https://github.com/biohazardous-man) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (4) - [`f4a0712`](https://github.com/MHSanaei/3x-ui/commit/f4a07121a99f037ff28770b2f329f0085deeda7e) feat(sub): add finalmask support to JSON subscriptions - [`08fca9e`](https://github.com/MHSanaei/3x-ui/commit/08fca9ed6600357f0b1c3bb1216567ecba86586b) feat(sub): modern xray JSON format with unified finalmask editor - [`d8e9d9b`](https://github.com/MHSanaei/3x-ui/commit/d8e9d9bb649da785cd648e89004dc92e38c7ef89) Merge branch 'main' into main - [`665557b`](https://github.com/MHSanaei/3x-ui/commit/665557bd1ffe5f2313c44668995c46657ac0beee) fix ### 📊 Changes **27 files changed** (+352 additions, -277 deletions) <details> <summary>View changed files</summary> 📝 `frontend/public/openapi.json` (+1 -1) 📝 `frontend/src/generated/types.ts` (+2 -4) 📝 `frontend/src/generated/zod.ts` (+2 -4) 📝 `frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx` (+15 -21) 📝 `frontend/src/models/setting.ts` (+1 -2) ➕ `frontend/src/pages/settings/SubJsonFinalMaskForm.tsx` (+55 -0) 📝 `frontend/src/pages/settings/SubscriptionFormatsTab.tsx` (+9 -147) 📝 `frontend/src/schemas/setting.ts` (+1 -2) 📝 `sub/sub.go` (+6 -11) 📝 `sub/subController.go` (+2 -3) 📝 `sub/subJsonService.go` (+78 -70) ➕ `sub/subJsonService_test.go` (+148 -0) 📝 `web/entity/entity.go` (+1 -2) 📝 `web/service/setting.go` (+5 -10) 📝 `web/translation/ar-EG.json` (+2 -0) 📝 `web/translation/en-US.json` (+2 -0) 📝 `web/translation/es-ES.json` (+2 -0) 📝 `web/translation/fa-IR.json` (+2 -0) 📝 `web/translation/id-ID.json` (+2 -0) 📝 `web/translation/ja-JP.json` (+2 -0) _...and 7 more files_ </details> ### 📄 Description ## Summary Add finalmask noise / fragment to 3x-ui JSON subscription endpoint. ## Why Right now only place where fragment or noise is displayed after setting it up in 3x-ui is outbound. However, modern xray expects fragment and noise filters in the finalmask (see https://xtls.github.io/en/config/transports/finalmask.html#fragment) Because of that modern clients don't see fragment/noise setting and can't apply it ## Type of change - [ ] Bug fix - [x] New feature - [x] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [x] Frontend (UI / panel pages) - [ ] Backend (API endpoints, login, settings) - [x] Xray config generation - [x] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? Opened subscription JSON endpoint, now fragmentation is shown both in outbound and finalmask. Ran unit test, it passed. ## Breaking changes If someone enables fragmentation it may need for clients to update their xray client version to more modern one. Sadly if old version of Xray core finds fragment in finalmask, it just can't process this config. But since this is opt-in feature, I wouldn't consider that breaking change. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [ ] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [ ] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:47 +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#5746
No description provided.