ClashRS: rule-based proxy routing in Rust
custom protocol network proxy
At a glance
- What is it?
- ClashRS is a Rust network proxy for local inbound proxies, transparent traffic handling, DNS, and multiple outbound protocols. Its broad protocol matrix brings integration work and platform-specific operational requirements.
- Who is it for?
- ClashRS suits users who need rule-based routing across several proxy protocols, especially on systems where transparent proxying or a large outbound selection matters. It is less suitable for a quick GUI installation, unsupported operating systems, or deployments that require a documented rollback and upgrade procedure.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 2 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Why ClashRS exists for proxy operators
ClashRS addresses the problem of routing network connections through user-defined rules instead of sending every application through one fixed path. The README describes a custom protocol, rule-based network proxy, with routing decisions based on source or destination IP, domain, GeoIP, and other traffic attributes. That makes it relevant to people who run a desktop or self-hosted proxy, need transparent forwarding, or want several outbound protocols behind one configuration.
The project is also aimed at operators who need local DNS service as part of the proxy. ClashRS documents local anti-spoofing DNS with remote UDP, TCP, DoH, or DoT upstreams, and it can expose local UDP, TCP, DoH, or DoT endpoints. This places DNS handling inside the same routing system instead of treating it as an unrelated utility. The repository layout includes separate `clash-dns`, `clash-netstack`, `clash-lib`, `clash-bin`, and `clash-ffi` crates, which supports that interpretation.
It is not presented as a general VPN client with a simplified user interface. The available inbounds include HTTP, SOCKS5, mixed HTTP and SOCKS5, Shadowsocks, AnyTLS, redir, TProxy, tunnel, and TUN. TUN is listed for all supported platforms, while TProxy and redir are Linux-specific. The project therefore serves people who accept configuration and operating-system setup in exchange for control over routing.
How ClashRS routes traffic and resolves DNS
The visible architecture is a Rust workspace organized around networking, configuration, DNS, the command-line binary, documentation, and foreign-function interfaces. The README identifies rule-based routing as the central mechanism. Traffic enters through a configured inbound, ClashRS evaluates it against routing rules, and the selected outbound handles the connection. The documentation does not include a complete rule-processing example, so the exact precedence and matching algorithm should be confirmed in the configuration reference before relying on a policy edge case.
ClashRS supports direct and reject outbounds in addition to proxy-specific outbounds. The documented outbound list includes Shadowsocks, SOCKS5, AnyTLS, Trojan, VMess, VLESS, WireGuard in userspace, Hysteria2, TUIC, ShadowQUIC, SSH, Tor onion routing, and Tailscale. Transports vary by protocol. For example, VMess and VLESS cover combinations involving TLS, WebSocket, HTTP/2, gRPC, and, for VLESS, REALITY. Hysteria2 and TUIC use QUIC, while WireGuard is described as a userspace UDP outbound.
DNS is part of the same proxy model rather than an incidental resolver. The README lists UDP, TCP, DoH, and DoT for both remote DNS connections and local DNS exposure. It also describes dynamic remote rule and proxy loading. Based on the repository layout, the `clash-dns` crate is the natural home for DNS behavior and `clash-netstack` for networking. Configuration semantics, rule ordering, and fallback behavior therefore need to be checked against the linked config reference.
Choosing an inbound and outbound in ClashRS
Inbound selection determines how applications submit traffic to ClashRS. HTTP is the conventional application proxy. SOCKS5 supports TCP and UDP, while mixed combines HTTP and SOCKS5 on one port. Shadowsocks and AnyTLS inbounds support multiple users. TUN provides transparent proxying across platforms, which is useful when the operating system should route traffic without configuring every application individually. Linux operators can also consider redir for TCP redirect or TProxy for TCP and UDP.
Outbound selection determines how ClashRS sends accepted traffic. Direct and reject are special cases, while the remaining choices cover proxy services, encrypted transports, mesh networking, and onion routing. The exact protocol feature may require compilation with a named Cargo feature. The README marks Shadowsocks, WireGuard, TUIC, ShadowQUIC, SSH, Tailscale, and Tor-related support with feature qualifiers, while some protocols do not carry such a qualifier in the table.
This breadth is useful when one configuration needs to reach different networks through different protocols. It also increases the number of combinations that must be configured correctly. A TLS option, transport, proxy type, credential field, and DNS setting are separate concerns. The README does not provide a complete end-to-end configuration for every outbound, so the config reference is necessary before assuming that a protocol listed in the support table is ready for a particular deployment.
Installing ClashRS and validating the first configuration
The easiest documented paths are a GUI integration, a prebuilt binary, or a Docker image. For a local build, the README lists `cmake` 3.29 or newer, `libclang`, `protoc`, and `pre-commit`. It also lists `nasm` for Windows. The repository's workspace version is `0.10.10`, and the default branch is `master`.
After cloning the repository, the documented local setup installs the hook tool and builds the project. The following commands reproduce the README's local build sequence:
pipx install pre-commit
pre-commit install
cargo buildThe README's shortest example creates a YAML file containing a local proxy port, then starts the debug binary with the `-c` option. The following is the documented first-use path:
port: 7890./target/debug/clash-rs -c sample.yamlThe process should start with the configuration file passed to `-c`. The command's help output also documents `-t`, which tests a configuration and exits, and `-d`, which sets the working directory for config-relative paths. This distinction matters because a configuration containing relative paths may behave differently when the working directory changes. The README does not show the exact success output of the test command, so the expected result is limited to the documented behavior: configuration validation completes and the process exits.
Platform limits and operational failure points
Platform support does not mean every deployment path is identical. On Windows, the README says users must copy the architecture-matched `wintun.dll` into the executable directory and run the program as administrator. That is a concrete operational requirement for TUN operation, not merely an installation note. Linux has additional distinctions for redir and TProxy, which are marked as Linux features. The project lists iOS support, including a ChocLite App Store option and TestFlight access, but the README does not document the full iOS configuration workflow.
Several protocols are optional build features. If an operator selects an outbound or inbound that is not enabled in the build, the documented feature requirements become a likely failure point. The README does not state the exact error text for a missing feature, so troubleshooting should begin by checking the selected Cargo features and the protocol documentation.
The repository also documents a compatibility mode, enabled by `--compatibility`, for behavior consistent with mihomo. That may help users migrating configurations, but it does not guarantee full behavioral equivalence. The documentation does not provide a migration checklist or rollback procedure. Users should therefore validate important rules, DNS settings, and inbound behavior before replacing an existing proxy.
ClashRS alternatives and maintenance implications
A GUI-based Clash client is the practical alternative for users who want a graphical configuration workflow. The README specifically links `LibNyanpasu/clash-nyanpasu` as a GUI option. Its documented difference is the interface and integration approach, not a claim about protocol coverage or performance. ClashRS is the lower-level choice when direct control of a Rust binary, command-line operation, or Apple framework integration matters.
Another alternative is using only a single-purpose proxy client for one inbound and one outbound. That avoids ClashRS's larger routing matrix, but it does not provide the documented rule-based routing, local DNS exposure, and many inbound modes as a combined feature set. The actual choice depends on whether protocol variety and transparent routing justify the configuration work.
Maintenance is relatively recent according to the repository facts: the last push was on 2026-10-14, and the repository is not archived. Recent releases include `v0.10.10` and `v0.10.9`, both dated 2026-10-05. Upgrade cost is not limited to replacing the binary. Administrators may need to review Cargo features, platform files such as `wintun.dll`, configuration compatibility, DNS behavior, and any custom dashboard or Apple framework build process. The README does not document a rollback command or a compatibility policy for every past configuration.
ClashRS uses the Apache-2.0 license. That permits use and modification under the license's terms, but users must preserve applicable notices and follow its conditions. The repository includes `LICENSE` and `NOTICE.md`; those files are the relevant source for compliance details.
Editorial conclusion
ClashRS suits users who need rule-based routing across several proxy protocols, especially on systems where transparent proxying or a large outbound selection matters. It is less suitable for a quick GUI installation, unsupported operating systems, or deployments that require a documented rollback and upgrade procedure. Check the first local port, platform prerequisites, feature requirements, configuration compatibility, and the cost of maintaining a Rust proxy before adopting it. Its Apache-2.0 license permits use and modification under that license, subject to its conditions and notice requirements.
Frequently asked questions
How do I install and build ClashRS?
The README lists a GUI option, prebuilt binaries, a Docker image, and a local Cargo build. For a local build, install `pre-commit` and run `cargo build` after preparing the listed native dependencies.
What is the first ClashRS configuration?
The README example contains `port: 7890` in a YAML file named `sample.yaml`. Start it with `./target/debug/clash-rs -c sample.yaml`.
Does ClashRS support TUN and Linux transparent proxying?
The README lists TUN as available across supported platforms, while redir and TProxy are Linux-specific. On Windows, TUN requires the architecture-matched `wintun.dll` in the executable directory and administrator execution.
Does ClashRS support more than HTTP and SOCKS5?
Yes. The documented outbound list includes Shadowsocks, AnyTLS, Trojan, VMess, VLESS, WireGuard, Hysteria2, TUIC, ShadowQUIC, SSH, Tor, and Tailscale, with some available through named features.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/ibigbug-clash-rs)