mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-06 00:01:35 +00:00
d15623a91fb23cb84a92a87ecc6c13fa6d6fea35
The queue to the TUN device dropped any packet past 512, TCP segments included, and a dropped segment stalls its connection until the retransmission timer fires. It is now two queues: TCP is only dropped past a backstop (a quarter of the memory budget), UDP is bounded in bytes (a sixteenth of it, at least 128 KiB) and drops whole datagrams, oldest first. UDP goes out first, but no more than four packets in a row while TCP waits. The queue of datagrams from the TUN device is bounded in bytes too, dropping the oldest. Config loses max_output_packets and max_udp_queue, and the NETSTACK_OUTPUT_CHANNEL_SIZE and NETSTACK_UDP_UPLINK_CHANNEL_SIZE options that fed them go.
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%
