A high-performance rule-based tunneling proxy kernel written in Rust. Shadowsocks, Trojan, transparent proxy, DNS snooping, web dashboard, and subscription management.
Shadowsocks, Trojan, VLESS (XTLS-Vision), HTTP, SOCKS5 outbound adapters with TCP/UDP relay. WebSocket, gRPC, H2, HTTPUpgrade transports.
Domain, IP-CIDR, GeoIP, port, process, network, regex rules with AND/OR/NOT logic composition. First-match-wins evaluation.
Built-in web UI at /ui for proxy switching, subscription management, group CRUD, rule editing, and live traffic monitoring.
Import Clash YAML subscriptions with proxies, groups, and rules. Auto-cached to disk for instant startup. Background refresh on intervals.
Built-in UDP DNS server with main + fallback nameservers, response caching, and IP→domain reverse lookup table for transparent proxy hostname recovery.
Kernel-level traffic interception via nftables (Linux) or pf (macOS). SNI extraction for HTTPS, DNS snooping for HTTP. SO_MARK loop avoidance. Auto firewall teardown.
Selector, URL-Test, Fallback, LoadBalance (round-robin / consistent-hashing), and Relay (chained hops) with multi-pass dependency resolution.
Single static binary. Install as a systemd service with one command. Pre-built binaries for Linux amd64/arm64, macOS arm64, and Windows amd64.
Encrypted Client Hello via BoringSSL. uTLS fingerprint spoofing (Chrome, Firefox, Safari, iOS, Android, Edge). DNS-based ECH config from HTTPS/SVCB records.
Async I/O with Tokio multi-threaded runtime. Zero-copy bidirectional relay. Minimal memory footprint with parking_lot locks.
Full runtime control via Axum-powered REST API. Manage proxies, rules, connections, subscriptions, and config at runtime.
| Crate | Purpose |
|---|---|
| mihomo-common | Core traits and types (ProxyAdapter, Rule, Metadata) |
| mihomo-trie | Domain trie for efficient pattern matching |
| mihomo-transport | TLS (rustls + BoringSSL), WebSocket, gRPC, H2, HTTPUpgrade |
| mihomo-proxy | Proxy protocol implementations and groups |
| mihomo-rules | Rule matching engine and parser |
| mihomo-dns | DNS resolver, cache, DNS snooping, server |
| mihomo-tunnel | Core routing, TCP/UDP relay, statistics |
| mihomo-listener | Inbound handlers (Mixed / HTTP / SOCKS5 / TProxy) |
| mihomo-config | YAML config parsing, subscription fetcher, persistence |
| mihomo-api | REST API (Axum) + embedded web dashboard |
| mihomo-app | CLI entry point |
Requires Rust 1.88+
cargo build --release
Copy and edit the example config
cp config.example.yaml config.yaml
# edit config.yaml with your servers
Start the proxy and open the dashboard
./target/release/mihomo -f config.yaml
# Open http://127.0.0.1:9090/ui
Use the proxy or add a subscription from the web UI
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
curl https://ipinfo.io