Direct — mihomo
Direct is mihomo's passthrough outbound. The schema is the bare minimum — just a name and the inherited BasicOption fields. Most users never declare one explicitly; mihomo auto-injects a DIRECT proxy at startup with sensible defaults.
Outbound
Entry under proxies: with type: direct. Embeds BasicOption (interface-name, routing-mark, ip-version, dialer-proxy, …).
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
name | string | (required) | <string> | Unique proxy name. mihomo also auto-injects a built-in `DIRECT` proxy that you do not need to declare. |
Source: adapter/outbound/direct.go:18-21 · pinned at v1.19.27 (5184081)
Examples
Implicit DIRECT — already available; just reference it from rules:
rules:
- DOMAIN-SUFFIX,local,DIRECT
- DOMAIN-KEYWORD,internal,DIRECT
- GEOIP,CN,DIRECTExplicit Direct proxy bound to a specific interface (useful for multi-WAN routing):
proxies:
- name: direct-wlan
type: direct
interface-name: wlan0
routing-mark: 0x1234
rules:
- DOMAIN-SUFFIX,internal,direct-wlanDirect proxy that dials through another proxy first (mihomo's chained-dialer trick):
proxies:
- name: direct-via-vps
type: direct
dialer-proxy: vps-tunnelBuilt-in proxies
mihomo always exposes three implicit names you can reference from rules or proxy groups without declaring them:
| Name | Type | Purpose |
|---|---|---|
DIRECT | direct | Plain passthrough, dual-stack, UDP enabled. |
REJECT | reject | Drop the connection entirely. Useful for blocking ad domains. |
COMPATIBLE | compatible | Direct-like, used by the loopback detector when no other proxy matches. |
You can override any of these by declaring a proxy with the same name — mihomo prefers the user-supplied version.
Notes
- The built-in
DIRECTis dual-stack with UDP enabled (adapter/outbound/direct.go:84-94). If you need IPv4-only or TCP-only direct, declare an explicit Direct proxy with the relevantip-version/udptoggles. dialer-proxyis mihomo-specific: it lets one proxy use another proxy's connection as its underlying socket. Combined withtype: direct, this turns the proxy into "route through X but speak plain TCP/UDP to the destination" — useful for chained tunnels.
Cross-core notes
- Xray-core calls this Freedom and exposes TCP/TLS fragmentation and noise-injection features for anti-DPI. See Freedom — Xray-core.
- sing-box has a similarly minimal Direct type and recently removed the destination-override fields from the outbound — use route actions instead. See Direct — sing-box.
Source: adapter/outbound/direct.go:18-21 · v1.19.27 (5184081)
