https://github.com/watfaq/clash-rs
custom protocol network proxy
https://github.com/watfaq/clash-rs
clash clash-rs clashrs hsalc ios proxy rust vpn
Last synced: 2 days ago
JSON representation
custom protocol network proxy
- Host: GitHub
- URL: https://github.com/watfaq/clash-rs
- Owner: Watfaq
- License: apache-2.0
- Created: 2022-09-20T16:25:24.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2026-02-22T07:06:40.000Z (2 months ago)
- Last Synced: 2026-02-22T10:22:28.032Z (2 months ago)
- Topics: clash, clash-rs, clashrs, hsalc, ios, proxy, rust, vpn
- Language: Rust
- Homepage: https://watfaq.gitbook.io/clashrs-user-manual/
- Size: 30.6 MB
- Stars: 1,568
- Watchers: 10
- Forks: 133
- Open Issues: 49
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Notice: NOTICE.md
Awesome Lists containing this project
README
ClashRS
A custom protocol, rule based network proxy software.
[](https://github.com/Watfaq/clash-rs/actions/workflows/ci.yml)
[](https://codecov.io/gh/Watfaq/clash-rs)
## ✨ Features
- 🌈 Flexible traffic routing rules based off source/destination IP/Domain/GeoIP etc.
- 📦 Local anti spoofing DNS with support of UDP/TCP/DoH/DoT remote, and expose it as a local UDP/TCP/DoH/DoT server.
- ⚙️ AnyTLS/Hysteria2/Shadowquic/Shadowsocks/Socks5(TCP/UDP)/SSH/Tailscale/tor(onion)/Trojan/Tuic/VLess/Vmess/Wireguard(userspace) outbound support with different underlying transports(gRPC/TLS/H2/WebSocket/etc.).
- 🔀 Multiple inbound modes: HTTP, SOCKS5, Mixed, Shadowsocks, Redir, TProxy, and TUN (utun) for transparent proxying.
- 🌍 Dynamic remote rule/proxy loader.
- 🎵 Tracing with Jaeger
## 🖥 Environment Support
- Linux
- macOS
- Windows
- You need to copy the [wintun.dll](https://wintun.net/) file which matches your architecture to the same directory as your executable and run your program as administrator.
- iOS
- [](https://apps.apple.com/by/app/choclite/id6467517938)
- TestFlight Access: [TestFlight](https://testflight.apple.com/join/cLy4Ub5C)
## 💰 Sponsors
- [Fast Access Cloud](https://fast-access.cloud/)
## 📦 Install
### Use With GUI
https://github.com/LibNyanpasu/clash-nyanpasu
### Download Prebuilt Binary
Can be found at https://github.com/Watfaq/clash-rs/releases
### Docker Image
https://github.com/Watfaq/clash-rs/pkgs/container/clash-rs
### Local Build
Dependencies
* cmake (3.29 or newer)
* libclang([LLVM](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.4))
* [nasm](https://www.nasm.us/pub/nasm/releasebuilds/2.16/win64/) (Windows)
* protoc(for geodata proto generation)
* [pre-commit](https://pre-commit.com/) for managing git hooks
```
$ pipx install pre-commit
$ pre-commit install
$ cargo build
```
## 🔨 Usage
### Example Config
sample.yaml:
```yaml
port: 7890
```
### Run
```shell
-> % ./target/debug/clash-rs -c sample.yaml
```
### Help
```shell
-> % ./target/debug/clash-rs -h
Usage: clash-rs [OPTIONS]
Options:
-d, --directory Set working directory (config-relative paths resolve from here)
-c, --config Specify configuration file [default: config.yaml] [short aliases: f]
-t, --test-config Test configuration and exit
-v, --version Print clash-rs version and exit [short aliases: V]
-l, --log-file Additionally log to file
--help-improve Enable crash report to help improve clash
--controller-ipc Specify the IPC path for the controller [aliases: --ext-ctl-pipe, --ext-ctl-unix]
--compatibility Enable compatibility mode for mihomo-consistent behavior
-h, --help Print help
```
## FFI
### Compile for apple platforms
To create a framework for iOS and macOS platforms
```shell
git clone https://github.com/Watfaq/clash-rs.git
cd clash-rs
chmod +x scripts/build_apple.sh
./scripts/build_apple.sh
```
This command will generate a `clashrs.xcframework` file in the `build` directory.
## 🔗 Links
- [Documentation](https://watfaq.gitbook.io/clashrs-user-manual/)
- [Config Reference](https://watfaq.github.io/clash-rs/)
- [Roadmap](https://github.com/Watfaq/clash-rs/issues/59)
## 🤝 Contributing
- [CONTRIBUTING.md](CONTRIBUTING.md)
- [Telegram User Group](https://t.me/thisisnotclash)
## ❤️ Inspired By
- [Dreamacro/clash](https://github.com/Dreamacro/clash)
- [eycorsican/leaf](https://github.com/eycorsican/leaf)