fix: pull the mihomo subscription directly #58

Merged
aleksei merged 1 commit from fix/mihomo-subscription-direct into main 2026-11-29 16:08:42 +00:00
Owner

mihomo pulls its proxy provider itself, and with TUN enabled that request is captured and matched like any other traffic — so it leaves through the tunnel it is about to feed. Once the subscription rotates its nodes (a REALITY short id changes) the cached nodes stop passing the handshake, and the refresh cannot go through them: the provider is stuck on stale servers and never recovers on its own.

The rendered config now sends the subscription host DIRECT, next to the existing DIRECT rules for the local networks, before the host's own mihomo_direct_domains.

No guard is needed around the rule: the role asserts mihomo_subscription_url | length > 0 before it renders the config, so urlsplit('hostname') always yields a host. Verified by rendering the template with a URL carrying a port — the rule comes out as DOMAIN-SUFFIX,sub.example.com,DIRECT and the file still parses as YAML.

`mihomo` pulls its proxy provider itself, and with TUN enabled that request is captured and matched like any other traffic — so it leaves through the tunnel it is about to feed. Once the subscription rotates its nodes (a REALITY short id changes) the cached nodes stop passing the handshake, and the refresh cannot go through them: the provider is stuck on stale servers and never recovers on its own. The rendered config now sends the subscription host DIRECT, next to the existing DIRECT rules for the local networks, before the host's own `mihomo_direct_domains`. No guard is needed around the rule: the role asserts `mihomo_subscription_url | length > 0` before it renders the config, so `urlsplit('hostname')` always yields a host. Verified by rendering the template with a URL carrying a port — the rule comes out as `DOMAIN-SUFFIX,sub.example.com,DIRECT` and the file still parses as YAML.
mihomo fetches the provider itself, and in TUN mode that request is captured and
matched by the same rules as any other traffic, so it leaves through the tunnel
it is about to feed. When the subscription rotates its nodes — a REALITY short
id changes — the cached nodes stop passing the handshake and the refresh cannot
go through them: the provider stays on stale servers and never recovers on its
own. Resolve the subscription host directly, above the host's own direct
domains.
aleksei deleted branch fix/mihomo-subscription-direct 2026-11-29 16:08:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
zoo/infra!58
No description provided.