[PR #6395] [MERGED] fix(sub): restore compatible SOCKS subscription inbound #6249

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6395
Author: @dawNotPoi
Created: 9/3/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @MHSanaei

Base: main ← Head: fix/6379-ios-json-subscription-socks


📝 Commits (1)

  • d890a17 fix(sub): restore compatible SOCKS subscription inbound

📊 Changes

8 files changed (+57 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 (+13 -0)
📝 docs/lib/xray/subscription.ts (+1 -1)
📝 internal/sub/default.json (+1 -1)
📝 internal/sub/json_service_test.go (+38 -0)

📄 Description

Summary

  • Emit the standard socks protocol for the JSON subscription's local inbound on port 10808 while preserving its existing mixed tag, UDP setting, and the separate HTTP inbound.
  • Keep the docs-side subscription generator and localized subscription documentation aligned with the runtime template.
  • Add runtime and docs regression tests for the local inbound compatibility contract.

Why

Happ 5.6.0 on iOS can import the generated JSON subscription but leaves every entry connected with zero traffic when the local inbound uses the mixed protocol alias. The reporter isolated the cause with a single-variable test: changing only mixed to socks restored traffic, while removing fakedns did not.

The pinned Xray core accepts socks with the same server configuration and HTTP fallback. Keeping the mixed tag avoids breaking custom rules that may reference the existing inbound tag.

Closes #6379

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?

  • Red-before-fix: both new tests failed against mixed and passed after the protocol change.
  • go test ./internal/sub -run TestDefaultJSONUsesCompatibleLocalInbounds -count=1
  • go build ./...
  • make test-go
  • cd docs && pnpm test (12 files, 106 tests)
  • cd docs && pnpm typecheck
  • cd docs && pnpm lint
  • cd docs && pnpm format:check

The issue reporter performed the iOS device A/B test; local tests verify that both generated subscription implementations now emit that exact working configuration while retaining the existing tag, UDP support, and HTTP inbound.

Screenshots / recordings

N/A — no UI layout or styling changes.

Breaking changes

None. Ports, tags, routing references, and inbound settings remain unchanged; only the local JSON subscription protocol identifier changes to the compatible standard name.

Checklist

  • I tested the generated configuration change locally and confirmed the described output.
  • I added or updated tests for the new behavior.
  • go build ./... and the test suite pass locally.
  • Frontend checks are not applicable; no frontend files changed.
  • I updated the user-facing subscription documentation.
  • 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/6395 **Author:** [@dawNotPoi](https://github.com/dawNotPoi) **Created:** 9/3/2026 **Status:** ✅ Merged **Merged:** 9/3/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/6379-ios-json-subscription-socks` --- ### 📝 Commits (1) - [`d890a17`](https://github.com/MHSanaei/3x-ui/commit/d890a17a8d920b3ba8b40fd7b224c416e9b60e3f) fix(sub): restore compatible SOCKS subscription inbound ### 📊 Changes **8 files changed** (+57 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` (+13 -0) 📝 `docs/lib/xray/subscription.ts` (+1 -1) 📝 `internal/sub/default.json` (+1 -1) 📝 `internal/sub/json_service_test.go` (+38 -0) </details> ### 📄 Description ## Summary - Emit the standard `socks` protocol for the JSON subscription's local inbound on port 10808 while preserving its existing `mixed` tag, UDP setting, and the separate HTTP inbound. - Keep the docs-side subscription generator and localized subscription documentation aligned with the runtime template. - Add runtime and docs regression tests for the local inbound compatibility contract. ## Why Happ 5.6.0 on iOS can import the generated JSON subscription but leaves every entry connected with zero traffic when the local inbound uses the `mixed` protocol alias. The reporter isolated the cause with a single-variable test: changing only `mixed` to `socks` restored traffic, while removing `fakedns` did not. The pinned Xray core accepts `socks` with the same server configuration and HTTP fallback. Keeping the `mixed` tag avoids breaking custom rules that may reference the existing inbound tag. Closes #6379 ## Type of change - [x] 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 - [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? - Red-before-fix: both new tests failed against `mixed` and passed after the protocol change. - `go test ./internal/sub -run TestDefaultJSONUsesCompatibleLocalInbounds -count=1` - `go build ./...` - `make test-go` - `cd docs && pnpm test` (12 files, 106 tests) - `cd docs && pnpm typecheck` - `cd docs && pnpm lint` - `cd docs && pnpm format:check` The issue reporter performed the iOS device A/B test; local tests verify that both generated subscription implementations now emit that exact working configuration while retaining the existing tag, UDP support, and HTTP inbound. ## Screenshots / recordings N/A — no UI layout or styling changes. ## Breaking changes None. Ports, tags, routing references, and inbound settings remain unchanged; only the local JSON subscription protocol identifier changes to the compatible standard name. ## Checklist - [x] I tested the generated configuration change locally and confirmed the described output. - [x] I added or updated tests for the new behavior. - [x] `go build ./...` and the test suite pass locally. - [x] Frontend checks are not applicable; no frontend files changed. - [x] I updated the user-facing subscription documentation. - [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:07:23 +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#6249
No description provided.