Skip to content

Missing Host header in s-ui generated Clash sub causes external WS nodes to timeout in Mihomo #1126

Description

@L3105180447

Description

When importing external WS nodes (e.g., VLESS) containing a host or sni parameter into the s-ui panel, the generated Clash subscription YAML is missing the headers: Host field under ws-opts.

This causes WebSocket handshake failures (usually HTTP 400 Bad Request) and node timeouts when testing the subscription in the Mihomo (Clash Meta) core, especially when the node is behind a strict CDN or reverse proxy (like Nginx).

Config Comparison

❌ Current generated config (Missing Headers):

    network: ws
    servername: bbb.example.com
    ws-opts:
      path: /yourpath?ed=2560
      # Missing headers field here

Expected generated config:
    network: ws
    servername: bbb.example.com
    ws-opts:
      path: /yourpath?ed=2560
      headers:
        Host: bbb.example.com  # ⬅️ Expect s-ui to auto-fill this based on SNI/Host

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestto deployConsiderable for implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions