[PR #6418] [MERGED] fix(sub): bind JSON local inbounds to 127.0.0.1 and keep mux.cool off Vision outbounds #6260

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6418
Author: @FZ1010
Created: 9/4/2026
Status: ✅ Merged
Merged: 9/5/2026
Merged by: @MHSanaei

Base: main ← Head: fix/sub-json-local-listen-vision-mux


📝 Commits (2)

  • b95b0d6 fix(sub): bind JSON local inbounds to 127.0.0.1 and keep mux.cool off Vision outbounds
  • eb28fe8 fix(sub): keep XUDP settings when disabling TCP mux on Vision outbounds

📊 Changes

9 files changed (+79 additions, -6 deletions)

View changed files

📝 docs/content/docs/en/config/subscription.mdx (+1 -1)
📝 docs/content/docs/fa/config/subscription.mdx (+1 -1)
📝 docs/content/docs/ru/config/subscription.mdx (+1 -1)
📝 docs/content/docs/zh/config/subscription.mdx (+1 -1)
📝 docs/lib/xray/subscription.test.ts (+2 -1)
📝 docs/lib/xray/subscription.ts (+8 -1)
📝 internal/sub/default.json (+2 -0)
📝 internal/sub/json_service.go (+19 -0)
📝 internal/sub/json_service_test.go (+44 -0)

📄 Description

Summary

  • Bind the JSON subscription's local SOCKS (10808) and HTTP (10809) inbounds to 127.0.0.1 in internal/sub/default.json, mirrored in the docs generator and the four subscription.mdx pages.
  • On VLESS outbounds that carry a flow (xtls-rprx-vision), emit the subJsonMux / per-host mux object with concurrency: -1: TCP mux.cool off, enabled, xudpConcurrency and xudpProxyUDP443 preserved (Xray reads the XUDP keys only under enabled).
  • Regression tests for both, on the Go side and in the docs generator suite.

Why

Closes #6417. Refs #6379 / #6395.

Inbounds. Without listen every client that runs the profile verbatim binds an unauthenticated proxy on 0.0.0.0, and iOS packet-tunnel clients cannot reach it at all — the Happ iOS "CONNECTED with zero traffic" symptom from #6379. #6395 restored socks, which works on that device; so does the old mixed inbound once it is bound to 127.0.0.1, and every client's own generated config binds to loopback. Binding explicitly removes the LAN exposure and makes the inbound independent of which protocol alias the client core happens to accept.

Mux. XTLS flows do not support mux.cool. With subJsonMux set, every VLESS+REALITY+Vision profile connects and then passes nothing: the client tunnels v1.mux.cool through the Vision flow and the server drops it with common/mux: unexpected network TCP. This is independent of the client — reproduced on Happ iOS, Happ Android 4.3.0, Happ macOS 3.3.6, V2Box iOS and desktop Xray 26.6.27. Dropping the whole object would also lose the operator's XUDP keys and any per-host muxParams, so only concurrency is changed — the same -1 convention the Xray docs and v2rayNG use for XTLS flows. Verified on the same box: concurrency: 8 on a Vision outbound → SSL_ERROR_SYSCALL, client log tunneling request to tcp:v1.mux.cool; concurrency: -1 with the XUDP keys kept → traffic passes, exit IP is the server.

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?

  • go vet ./internal/sub/ && go test ./internal/sub/ — green, including the new TestSubJsonServiceVisionFlowDisablesTCPMuxOnly and the extended TestDefaultJSONUsesCompatibleLocalInbounds (both fail on main).
  • cd docs && pnpm exec vitest run lib/xray/subscription.test.ts — 13/13.
  • On a 3x-ui v3.7.0 box (VLESS, tcp+reality www.aws.amazon.com, xtls-rprx-vision), with verdicts from the panel's per-client traffic counters and ss on the server:
    • served JSON as on main (no listen) → Happ iOS 5.2.x: CONNECTED, zero traffic; with listen: 127.0.0.1 → works (same device, same profile otherwise).
    • served JSON with subJsonMux → dead on Happ iOS/Android/macOS, V2Box iOS, desktop Xray (common/mux: unexpected network TCP on the server); with concurrency: -1 on the Vision outbound → works (desktop Xray, exit IP = server); removing the mux block entirely also works on all five clients.

🔄 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/6418 **Author:** [@FZ1010](https://github.com/FZ1010) **Created:** 9/4/2026 **Status:** ✅ Merged **Merged:** 9/5/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/sub-json-local-listen-vision-mux` --- ### 📝 Commits (2) - [`b95b0d6`](https://github.com/MHSanaei/3x-ui/commit/b95b0d6b1931d5f016e3d1800547faadd2f5a564) fix(sub): bind JSON local inbounds to 127.0.0.1 and keep mux.cool off Vision outbounds - [`eb28fe8`](https://github.com/MHSanaei/3x-ui/commit/eb28fe8670ef0cc9f09a4ae4415c8c1bb258ff6b) fix(sub): keep XUDP settings when disabling TCP mux on Vision outbounds ### 📊 Changes **9 files changed** (+79 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/en/config/subscription.mdx` (+1 -1) 📝 `docs/content/docs/fa/config/subscription.mdx` (+1 -1) 📝 `docs/content/docs/ru/config/subscription.mdx` (+1 -1) 📝 `docs/content/docs/zh/config/subscription.mdx` (+1 -1) 📝 `docs/lib/xray/subscription.test.ts` (+2 -1) 📝 `docs/lib/xray/subscription.ts` (+8 -1) 📝 `internal/sub/default.json` (+2 -0) 📝 `internal/sub/json_service.go` (+19 -0) 📝 `internal/sub/json_service_test.go` (+44 -0) </details> ### 📄 Description ## Summary - Bind the JSON subscription's local SOCKS (10808) and HTTP (10809) inbounds to `127.0.0.1` in `internal/sub/default.json`, mirrored in the docs generator and the four `subscription.mdx` pages. - On VLESS outbounds that carry a flow (`xtls-rprx-vision`), emit the `subJsonMux` / per-host mux object with `concurrency: -1`: TCP mux.cool off, `enabled`, `xudpConcurrency` and `xudpProxyUDP443` preserved (Xray reads the XUDP keys only under `enabled`). - Regression tests for both, on the Go side and in the docs generator suite. ## Why Closes #6417. Refs #6379 / #6395. **Inbounds.** Without `listen` every client that runs the profile verbatim binds an unauthenticated proxy on `0.0.0.0`, and iOS packet-tunnel clients cannot reach it at all — the Happ iOS "CONNECTED with zero traffic" symptom from #6379. #6395 restored `socks`, which works on that device; so does the old `mixed` inbound once it is bound to `127.0.0.1`, and every client's own generated config binds to loopback. Binding explicitly removes the LAN exposure and makes the inbound independent of which protocol alias the client core happens to accept. **Mux.** XTLS flows do not support mux.cool. With `subJsonMux` set, every VLESS+REALITY+Vision profile connects and then passes nothing: the client tunnels `v1.mux.cool` through the Vision flow and the server drops it with `common/mux: unexpected network TCP`. This is independent of the client — reproduced on Happ iOS, Happ Android 4.3.0, Happ macOS 3.3.6, V2Box iOS and desktop Xray 26.6.27. Dropping the whole object would also lose the operator's XUDP keys and any per-host `muxParams`, so only `concurrency` is changed — the same `-1` convention the Xray docs and v2rayNG use for XTLS flows. Verified on the same box: `concurrency: 8` on a Vision outbound → `SSL_ERROR_SYSCALL`, client log `tunneling request to tcp:v1.mux.cool`; `concurrency: -1` with the XUDP keys kept → traffic passes, exit IP is the server. ## Type of change - [x] Bug fix - [ ] New feature - [ ] Refactoring (no behavior change) - [x] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [ ] Frontend (UI / panel pages) - [ ] Backend (API endpoints, login, settings) - [ ] 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? - `go vet ./internal/sub/ && go test ./internal/sub/` — green, including the new `TestSubJsonServiceVisionFlowDisablesTCPMuxOnly` and the extended `TestDefaultJSONUsesCompatibleLocalInbounds` (both fail on `main`). - `cd docs && pnpm exec vitest run lib/xray/subscription.test.ts` — 13/13. - On a 3x-ui v3.7.0 box (VLESS, tcp+reality `www.aws.amazon.com`, `xtls-rprx-vision`), with verdicts from the panel's per-client traffic counters and `ss` on the server: - served JSON as on `main` (no `listen`) → Happ iOS 5.2.x: CONNECTED, zero traffic; with `listen: 127.0.0.1` → works (same device, same profile otherwise). - served JSON with `subJsonMux` → dead on Happ iOS/Android/macOS, V2Box iOS, desktop Xray (`common/mux: unexpected network TCP` on the server); with `concurrency: -1` on the Vision outbound → works (desktop Xray, exit IP = server); removing the mux block entirely also works on all five clients. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:27 +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#6260
No description provided.