Skip to content

[Feature] Bypass Chinese apps in Rule mode via domain-based rule-set #108

@mixc6763-prog

Description

@mixc6763-prog

Background

ClashFX v1.0.38 introduced the "Bypass Common Chinese Apps" toggle which injects a PROCESS-NAME rule-set from Clash-FX/cn-apps-direct. This works great under Enhanced Mode (TUN), but silently does nothing under Rule mode because mihomo cannot see process names when acting as a plain HTTP/SOCKS proxy.

v1.1.2.1 gated the toggle behind Enhanced Mode (greyed out + tooltip in Rule mode), which fixes the UI confusion — but Rule-mode users still have no built-in way to get the same "Chinese apps go DIRECT" behaviour. They have to manually edit their config yaml to add domain rules, which:

  • breaks when the subscription auto-updates and overwrites their config
  • isn't discoverable for non-technical users
  • duplicates work everyone has to do individually

Reported in #104 — user is in Rule mode, opened the bypass toggle expecting NetEase Music to go DIRECT, was confused when it didn't.

Proposed solution

  1. New rule-set repo: Clash-FX/cn-apps-direct-domains ✅ DONE

    • DOMAIN-SUFFIX-based companion to cn-apps-direct
    • Works under both Rule mode and Enhanced Mode
    • Domestic-only domains (no larksuite.com / tiktok.com international tenants)
    • 120 rules across 15 categories at launch
  2. ClashFX-side: add a parallel toggle

    • Menu placement: same area as "Bypass Common Chinese Apps", e.g. "Bypass Chinese Apps (by domain)" or merge into a single mode-aware toggle
    • Inject the rule-provider + RULE-SET reference into both:
      • Rule mode: into the active config's rule-providers / rules sections
      • Enhanced Mode: into .enhanced_config.yaml alongside cn-apps-direct
    • Persist preference like the existing Settings.bypassChineseApps
    • Update auto every 24h (same cadence as cn-apps-direct)
  3. Decision: merge or coexist?

    • Option A: single toggle "Bypass Common Chinese Apps" injects both rule-sets (PROCESS-NAME for TUN, DOMAIN-SUFFIX for both). Simplest UX, slight cost: domain rules can over-match (e.g. qq.com catches Tencent's cloud services too, which most users still want direct anyway).
    • Option B: two toggles. More precise control, more menu clutter.

    Lean Option A: single toggle, mode-aware injection. PROCESS-NAME rules added only when Enhanced Mode is on; DOMAIN-SUFFIX rules added unconditionally when the toggle is on.

Implementation tasks

  • Decide A vs B (Option A recommended)
  • Implement injection of cn-apps-direct-domains rule-provider into Rule-mode active config
  • Wire up to existing Settings.bypassChineseApps toggle (or add a new one if B)
  • Update actionToggleBypassChineseApps to also trigger rule-provider injection in Rule mode
  • Update the menu tooltip to reflect the new behaviour
  • Update config-editor guide to mention the toggle
  • Update README's "Bypass Common Chinese Apps" section to mention domain-based fallback
  • Ship in next minor (target: v1.2.x)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions