mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 16:02:32 +00:00
263cff16b76c54cafb89296d741cf56b64ec3d46
StatManager now keeps cumulative (sent, recvd) bytes per outbound tag. A finished session is added once, when its session end is logged; live sessions are added at query time, so the totals stay exact without touching the per-byte read/write path. - RuntimeManager::get_outbound_traffic() returns (tag, sent, recvd) - leaf_get_outbound_traffic(rt_id, ctx, cb) reports them over FFI, taking the stat lock synchronously rather than building a tokio runtime per call - test: closed + live accounting, and a repeated session end
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%
