[PR #5815] [MERGED] feat(xray): default outbound in basic routing #5995

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5815
Author: @rqzbeh
Created: 7/5/2026
Status: ✅ Merged
Merged: 7/8/2026
Merged by: @MHSanaei

Base: main ← Head: feat/routing-default-outbound


📝 Commits (4)

  • 2a48028 feat(xray): default outbound picker in basic routing
  • 5bc4453 fix(xray): keep direct/blocked outbounds when changing default
  • 252d6f8 Merge branch 'main' into feat/routing-default-outbound
  • d7c5163 style(routing): revert incidental whitespace churn

📊 Changes

17 files changed (+138 additions, -15 deletions)

View changed files

📝 frontend/src/pages/xray/basics/constants.ts (+1 -0)
📝 frontend/src/pages/xray/basics/helpers.ts (+23 -0)
📝 frontend/src/pages/xray/routing/RoutingBasic.tsx (+24 -2)
➕ frontend/src/test/routing-default-outbound.test.ts (+51 -0)
📝 internal/web/translation/ar-EG.json (+3 -1)
📝 internal/web/translation/en-US.json (+3 -1)
📝 internal/web/translation/es-ES.json (+3 -1)
📝 internal/web/translation/fa-IR.json (+3 -1)
📝 internal/web/translation/id-ID.json (+3 -1)
📝 internal/web/translation/ja-JP.json (+3 -1)
📝 internal/web/translation/pt-BR.json (+3 -1)
📝 internal/web/translation/ru-RU.json (+3 -1)
📝 internal/web/translation/tr-TR.json (+3 -1)
📝 internal/web/translation/uk-UA.json (+3 -1)
📝 internal/web/translation/vi-VN.json (+3 -1)
📝 internal/web/translation/zh-CN.json (+3 -1)
📝 internal/web/translation/zh-TW.json (+3 -1)

📄 Description

Summary

Adds a Default Outbound field to Xray → Routing → Basic Routing so unmatched traffic uses a chosen outbound (freedom/direct, blackhole/blocked, or any template outbound tag) by placing it first in the outbounds list.

Why

Users often want a deny-by-default setup (only explicit rules pass) or want all unmatched traffic to go through WARP or another proxy without manually reordering outbounds on the Outbounds tab.

Type of change

  • New feature
  • Bug fix
  • 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?

  • npx vitest run src/test/routing-default-outbound.test.ts (get/set default tag, blocked creation, reorder)
  • go test ./internal/xray/... -short
  • go build .
  • Manual: open Panel → Xray → Routing → Basic Routing, change Default Outbound to blocked or a custom tag (e.g. warp), save template, confirm first outbound in JSON matches selection and Route Tester shows default-outbound message when no rule matches.

Screenshots / recordings

N/A (simple Select at top of Basic Routing).

Breaking changes

None.

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/5815 **Author:** [@rqzbeh](https://github.com/rqzbeh) **Created:** 7/5/2026 **Status:** ✅ Merged **Merged:** 7/8/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/routing-default-outbound` --- ### 📝 Commits (4) - [`2a48028`](https://github.com/MHSanaei/3x-ui/commit/2a48028e7f9d120afe503383da27728f3b020322) feat(xray): default outbound picker in basic routing - [`5bc4453`](https://github.com/MHSanaei/3x-ui/commit/5bc4453cea810d60598ccf84ab6018384bcca47e) fix(xray): keep direct/blocked outbounds when changing default - [`252d6f8`](https://github.com/MHSanaei/3x-ui/commit/252d6f8309de0f2df98f77b8582ecce142ce5607) Merge branch 'main' into feat/routing-default-outbound - [`d7c5163`](https://github.com/MHSanaei/3x-ui/commit/d7c51634a3abb24c2d6788c778dc79416244a1ec) style(routing): revert incidental whitespace churn ### 📊 Changes **17 files changed** (+138 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/pages/xray/basics/constants.ts` (+1 -0) 📝 `frontend/src/pages/xray/basics/helpers.ts` (+23 -0) 📝 `frontend/src/pages/xray/routing/RoutingBasic.tsx` (+24 -2) ➕ `frontend/src/test/routing-default-outbound.test.ts` (+51 -0) 📝 `internal/web/translation/ar-EG.json` (+3 -1) 📝 `internal/web/translation/en-US.json` (+3 -1) 📝 `internal/web/translation/es-ES.json` (+3 -1) 📝 `internal/web/translation/fa-IR.json` (+3 -1) 📝 `internal/web/translation/id-ID.json` (+3 -1) 📝 `internal/web/translation/ja-JP.json` (+3 -1) 📝 `internal/web/translation/pt-BR.json` (+3 -1) 📝 `internal/web/translation/ru-RU.json` (+3 -1) 📝 `internal/web/translation/tr-TR.json` (+3 -1) 📝 `internal/web/translation/uk-UA.json` (+3 -1) 📝 `internal/web/translation/vi-VN.json` (+3 -1) 📝 `internal/web/translation/zh-CN.json` (+3 -1) 📝 `internal/web/translation/zh-TW.json` (+3 -1) </details> ### 📄 Description ## Summary Adds a **Default Outbound** field to Xray → Routing → Basic Routing so unmatched traffic uses a chosen outbound (freedom/direct, blackhole/blocked, or any template outbound tag) by placing it first in the outbounds list. ## Why Users often want a deny-by-default setup (only explicit rules pass) or want all unmatched traffic to go through WARP or another proxy without manually reordering outbounds on the Outbounds tab. ## Type of change - [x] New feature - [ ] Bug fix - [ ] 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 - [ ] 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? - `npx vitest run src/test/routing-default-outbound.test.ts` (get/set default tag, blocked creation, reorder) - `go test ./internal/xray/... -short` - `go build .` - Manual: open **Panel → Xray → Routing → Basic Routing**, change Default Outbound to `blocked` or a custom tag (e.g. `warp`), save template, confirm first outbound in JSON matches selection and Route Tester shows default-outbound message when no rule matches. ## Screenshots / recordings N/A (simple Select at top of Basic Routing). ## Breaking changes None. ## 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:05:35 +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#5995
No description provided.