Skip to content

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, …).

FieldTypeDefaultAllowed valuesDescription
namestring(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:

yaml
rules:
  - DOMAIN-SUFFIX,local,DIRECT
  - DOMAIN-KEYWORD,internal,DIRECT
  - GEOIP,CN,DIRECT

Explicit Direct proxy bound to a specific interface (useful for multi-WAN routing):

yaml
proxies:
  - name: direct-wlan
    type: direct
    interface-name: wlan0
    routing-mark: 0x1234

rules:
  - DOMAIN-SUFFIX,internal,direct-wlan

Direct proxy that dials through another proxy first (mihomo's chained-dialer trick):

yaml
proxies:
  - name: direct-via-vps
    type: direct
    dialer-proxy: vps-tunnel

Built-in proxies

mihomo always exposes three implicit names you can reference from rules or proxy groups without declaring them:

NameTypePurpose
DIRECTdirectPlain passthrough, dual-stack, UDP enabled.
REJECTrejectDrop the connection entirely. Useful for blocking ad domains.
COMPATIBLEcompatibleDirect-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 DIRECT is 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 relevant ip-version / udp toggles.
  • dialer-proxy is mihomo-specific: it lets one proxy use another proxy's connection as its underlying socket. Combined with type: 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)

Core Tutorial by Argsment