Skip to content

Mihomo xHTTP subscriptions are skipped and xHTTP advanced fields are not mapped #508

@Rerowros

Description

@Rerowros

Describe the bug
In PasarGuard Panel v4.0.2, xHTTP hosts are not generated correctly for Clash Meta / Mihomo subscriptions.

ClashMetaConfiguration inherits ClashConfiguration.add(), and the base add() method skips xhttp inbounds:

if inbound.network in ("kcp", "splithttp", "xhttp"):
    return

Because of this, xHTTP hosts are skipped entirely in Clash Meta / Mihomo subscriptions.

There is an _transport_xhttp() method in app/subscription/clash.py, but it is effectively unreachable for clash_meta because of the inherited skip behavior.

Also, even if the skip is removed, the current Mihomo xHTTP serializer maps only a small subset of supported xhttp-opts. It does not map several advanced xHTTP fields required by some CDN/xHTTP setups, for example:

  • x-padding-obfs-mode
  • x-padding-key
  • x-padding-header
  • x-padding-placement
  • x-padding-method
  • uplink-http-method
  • session-placement
  • session-key
  • seq-placement
  • seq-key
  • uplink-data-placement
  • uplink-data-key
  • uplink-chunk-size
  • sc-max-each-post-bytes
  • sc-min-posts-interval-ms
  • reuse-settings / XMUX

This makes advanced xHTTP/CDN configurations unusable in Mihomo-based clients.

To Reproduce
Steps to reproduce the behavior:

  1. Create an Xray core config with a VLESS xHTTP inbound.
  2. Use advanced xhttpSettings.extra options, for example uplinkHTTPMethod, sessionKey, seqKey, xPaddingObfsMode, or XMUX-related options.
  3. Create a host that uses this xHTTP inbound.
  4. Generate or download a Clash Meta / Mihomo subscription.
  5. Check the generated subscription.

Result:
The xHTTP host is missing from the Clash Meta / Mihomo subscription, or the generated xhttp-opts do not contain the required advanced fields.

Relevant source locations:

  • app/subscription/clash.py
    • ClashConfiguration.add() skips xhttp
    • ClashMetaConfiguration inherits this behavior
    • _transport_xhttp() maps only a limited subset of xHTTP options

Expected behavior
Clash Meta / Mihomo subscriptions should include xHTTP hosts.

ClashMetaConfiguration.add() should not inherit the classic Clash skip behavior for xhttp.

The generated Mihomo config should include all supported xhttp-opts, including advanced fields such as session/seq settings, uplink HTTP method, x-padding options, and XMUX/reuse settings.

Classic Clash can continue to skip unsupported transports if needed, but Clash Meta / Mihomo should support xHTTP according to Mihomo capabilities.

Screenshots
Not applicable.

Machine details (please complete the following information):

  • OS: Ubuntu server / Docker deployment
  • Python version: Panel Docker image default
  • Nodejs version: Not relevant
  • Browser: Not relevant for this issue

Additional context
This appears to be a panel-side subscription generation issue, not a node runtime issue.

VLESS URI and Xray JSON subscription generation already serialize advanced xHTTP options more completely in:

  • app/subscription/links.py
  • app/subscription/xray.py

But Clash Meta / Mihomo generation in app/subscription/clash.py skips xHTTP entirely because ClashMetaConfiguration inherits the base ClashConfiguration.add() skip list.

sing_box also skips xHTTP in app/subscription/singbox.py, but that may be expected if sing-box does not support xHTTP transport yet.

Suggested acceptance criteria:

  • ClashMetaConfiguration.add() should not skip xhttp.
  • Keep xhttp skipped only for classic Clash if classic Clash does not support it.
  • Mihomo _transport_xhttp() should serialize all supported xHTTP options.
  • XMUX should be serialized as Mihomo reuse-settings.
  • download-settings should be serialized using a Mihomo-specific serializer, not raw internal subscription data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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