Welcome to ClashRS User Manual¶
ClashRS is a high-performance, rule-based network proxy core written in Rust. It lets you route TCP and UDP traffic flexibly across multiple proxy protocols, built-in anti-spoofing DNS, transparent proxying / TUN devices, and dynamic remote providers.
Documentation Baseline
This manual reflects ClashRS v0.10.x (Watfaq/clash-rs), including Mihomo compatibility mode, service-mode safe path enforcement, multi-protocol listeners, and all currently supported inbound and outbound protocols.
Key Features¶
- Flexible Traffic Routing: 18 rule types including domain, regex, GeoIP, GeoSite, CIDR, port range, process name/path, inbound type/user, logical combinators (
AND/OR/NOT), and rule sets (yaml,text,mrs). - Built-in Anti-Spoofing DNS: Supports UDP, TCP, DoT, DoH, and DHCP upstreams, local UDP/TCP/DoT/DoH/DoH3 listeners, Fake-IP mode, fallback filtering, per-domain policies, EDNS Client Subnet, and rule-aware upstream routing.
- Rich Inbound Modes: HTTP, SOCKS5, Mixed, Shadowsocks (including SS2022 multi-user), AnyTLS, Hysteria2, Tunnel port forwarding, Linux/Android TProxy, Linux Redir, and cross-platform TUN.
- 16 Outbound Protocols: Direct, Reject, Shadowsocks / SS2022 (with obfs / v2ray-plugin / ShadowTLS), SOCKS5, AnyTLS, Trojan, VMess, VLESS (with REALITY & XTLS Vision), WireGuard, TUIC v5, Hysteria2, Naive (Cronet), ShadowQUIC, SSH, Tailscale, and Tor.
- Smart Proxy Groups & Providers:
select,url-test(with circuit breaker, adaptive tolerance, and manual lock),fallback,load-balance,relay, andsmartscoring groups, plus HTTP/File/Inline providers with hot reload. - Controller & Drop-in Compatibility: REST + WebSocket controller over TCP, Unix Domain Socket, or Windows Named Pipe, embedded Web Dashboard, and Mihomo compatibility mode (
--compatibility).
Supported Platforms¶
| Platform | Runtime Support | Notes |
|---|---|---|
| Linux | Full (CLI, TUN, TProxy, Redir) | Policy routing (route-table) and SO_MARK anti-loop |
| Windows | Full (CLI, GUI, Wintun TUN) | Run TUN as Administrator; supports wintun.dll or --features wintun-embed and WFP strict-route |
| macOS | Full (CLI, GUI, utun TUN) |
Supports utun* devices and XCFramework builds |
| FreeBSD | CLI, TUN | Multi-FIB routing via setfib |
| Android | FFI / TUN (fd://) / TProxy |
Official client: clash-android (proof of concept) |
| iOS / iPadOS | FFI / TUN (fd://) |
Official client: ChocLite |
Quick Navigation¶
- New to ClashRS? Start with Quick Start, CLI & Environment, or GUI & Clients.
- Writing a config file? Read General Configuration, DNS, TUN, Inbounds, Outbounds, Proxy Groups, Routing Rules, and Full Example.
- Migrating from Mihomo or integrating a dashboard? See Mihomo Compatibility & Safe Paths and REST API & Controller.
- Contributing to ClashRS? Read the Developer Guide covering Cancellation Safety, Graceful Shutdown, Structured Concurrency, and Error Handling.
Links¶
- Source Repository: Watfaq/clash-rs
- Releases: GitHub Releases
- Container Images: ghcr.io/watfaq/clash-rs
- Community: Telegram User Group