mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 16:02:32 +00:00
ff6ffcd489d5e04645835004c8ad7105f80513ee
Thirty-five commits since the pinned 4cc3162, and the reason to take them is that most are corrections to the lwIP binding rather than features. Among them: a use-after-free in `UdpSocket::split`, a data race and aliasing UB on the output path, a UDP callback that shared context unsafely, `sys_now` arithmetic widened to 64 bits so it no longer overflows on 32-bit targets, pcbs no longer touched after lwIP has freed them or parked them in TIME_WAIT, and a timer task that is now aborted when the stack is dropped instead of outliving it. The rest is capacity and backpressure work that shows up under connection churn: pools sized for the connection counts each platform is expected to reach, a shorter TCP_MSL to cut TIME_WAIT pressure, a smaller window on iOS to cap per-connection buffering, and `poll_flush`/`poll_write` parking on transient ERR_MEM rather than failing the connection. The bindings are now generated at build time for the exact target rather than checked in, so their layouts always match what is being compiled against. That needs libclang, which leaf already requires: bindgen is an unconditional build dependency of the crate. `inbound-tun` is in the default feature set, so this is on the ordinary build path rather than an opt-in one.
Leaf
A versatile and efficient proxy framework.
Supported Protocols
Proxy Protocols
| Protocol | Inbound | Outbound |
|---|---|---|
| HTTP | ✅ | ❌ |
| SOCKS5 | ✅ | ✅ |
| Shadowsocks | ✅ | ✅ |
| Trojan | ✅ | ✅ |
| VMess | ❌ | ✅ |
| Vless | ❌ | ✅ |
Transports & Security
| Transport | Inbound | Outbound | Notes |
|---|---|---|---|
| WebSocket | ✅ | ✅ | |
| TLS | ✅ | ✅ | |
| QUIC | ✅ | ✅ | |
| AMux | ✅ | ✅ | Leaf specific multiplexing |
| Obfs | ❌ | ✅ | Simple obfuscation |
| Reality | ❌ | ✅ | Xray Reality |
| MPTP | ✅ | ✅ | Multi-path Transport Protocol (Aggregation) (Architecture, Usage) |
Traffic Control
| Feature | Inbound | Outbound | Notes |
|---|---|---|---|
| Chain | ✅ | ✅ | Proxy chaining |
| Failover | ❌ | ✅ | Failover with health check |
Transparent Proxying
| Mechanism | Inbound | Outbound | Notes |
|---|---|---|---|
| TUN | ✅ | ❌ | Linux, macOS, Windows, iOS, Android; lwip, smoltcp |
| NF | ✅ | ❌ | Windows, NetFilter SDK |
| TPROXY | ❌ | ❌ | Linux; Coming soon |
Building
cargo build -p leaf-cli --release
./target/debug/leaf --help
License
This project is licensed under the Apache License 2.0.
Description
A versatile and efficient proxy framework.
4.5 MiB
0 Stars
1 Watchers
0 Forks
Languages
Rust
99.5%
Shell
0.5%
