Repository navigation
Description
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"):
returnBecause 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-modex-padding-keyx-padding-headerx-padding-placementx-padding-methoduplink-http-methodsession-placementsession-keyseq-placementseq-keyuplink-data-placementuplink-data-keyuplink-chunk-sizesc-max-each-post-bytessc-min-posts-interval-msreuse-settings/ XMUX
This makes advanced xHTTP/CDN configurations unusable in Mihomo-based clients.
To Reproduce
Steps to reproduce the behavior:
- Create an Xray core config with a VLESS xHTTP inbound.
- Use advanced
xhttpSettings.extraoptions, for exampleuplinkHTTPMethod,sessionKey,seqKey,xPaddingObfsMode, or XMUX-related options. - Create a host that uses this xHTTP inbound.
- Generate or download a Clash Meta / Mihomo subscription.
- 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.pyClashConfiguration.add()skipsxhttpClashMetaConfigurationinherits 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.pyapp/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 skipxhttp.- Keep
xhttpskipped 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-settingsshould be serialized using a Mihomo-specific serializer, not raw internal subscription data.
Activity