[PR #5020] [CLOSED] fix(subscription): include XHTTP padding options in Clash output #5759

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5020
Author: @w3struk
Created: 6/6/2026
Status: ❌ Closed

Base: main ← Head: fix/mihomo-xhttp-padding


📝 Commits (1)

  • ff4af10 fix(sub): include XHTTP padding in Clash output

📊 Changes

2 files changed (+63 additions, -4 deletions)

View changed files

📝 sub/subClashService.go (+15 -0)
📝 sub/subClashService_test.go (+48 -4)

📄 Description

What changed

Map the six Xray XHTTP padding fields from xhttpSettings into Mihomo's xhttp-opts keys when generating Clash subscriptions:

  • xPaddingObfsMode -> x-padding-obfs-mode
  • xPaddingBytes -> x-padding-bytes
  • xPaddingKey -> x-padding-key
  • xPaddingHeader -> x-padding-header
  • xPaddingPlacement -> x-padding-placement
  • xPaddingMethod -> x-padding-method

Empty string values are omitted, while an explicitly present boolean value is preserved. Existing path, host, and mode behavior is unchanged.

Why

The regular VLESS subscription retains these fields in extra, but the Clash/Mihomo YAML generator previously emitted only path, host, and mode. Mihomo clients therefore imported an incomplete XHTTP configuration.

The key names and value types match Mihomo v1.19.27's XHTTPOptions and VLESS-extra conversion.

Validation

  • go test ./sub
  • go test ./...

🔄 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/5020 **Author:** [@w3struk](https://github.com/w3struk) **Created:** 6/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/mihomo-xhttp-padding` --- ### 📝 Commits (1) - [`ff4af10`](https://github.com/MHSanaei/3x-ui/commit/ff4af10cd0f64c5ab6de1056cc162c65a06c8030) fix(sub): include XHTTP padding in Clash output ### 📊 Changes **2 files changed** (+63 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `sub/subClashService.go` (+15 -0) 📝 `sub/subClashService_test.go` (+48 -4) </details> ### 📄 Description ## What changed Map the six Xray XHTTP padding fields from `xhttpSettings` into Mihomo's `xhttp-opts` keys when generating Clash subscriptions: - `xPaddingObfsMode` -> `x-padding-obfs-mode` - `xPaddingBytes` -> `x-padding-bytes` - `xPaddingKey` -> `x-padding-key` - `xPaddingHeader` -> `x-padding-header` - `xPaddingPlacement` -> `x-padding-placement` - `xPaddingMethod` -> `x-padding-method` Empty string values are omitted, while an explicitly present boolean value is preserved. Existing path, host, and mode behavior is unchanged. ## Why The regular VLESS subscription retains these fields in `extra`, but the Clash/Mihomo YAML generator previously emitted only path, host, and mode. Mihomo clients therefore imported an incomplete XHTTP configuration. The key names and value types match Mihomo v1.19.27's `XHTTPOptions` and VLESS-extra conversion. ## Validation - `go test ./sub` - `go test ./...` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:52 +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#5759
No description provided.