mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 08:01:26 +00:00
63dceed4799cee30212c27cf8be45df7413fc126
A certificate and its key are configured the same way and were read two different ways. `certificate` was recognised inline -- if it contains "-----BEGIN", it is the PEM itself -- and `certificateKey` never was: it went straight to the path branch, so an inline key became a filename made of PEM, joined onto the asset directory. What the operator saw was "no private keys found" about a key that was right there in the configuration. It affected the quic and tls settings on both sides, all four with their own copy of the same twelve lines. There is one resolver now, used for both halves of every keypair, and three tests that say which of the three shapes -- inline, absolute, relative -- goes where. Found by an end-to-end matrix that configures every stack from one self-signed certificate held in memory: with `rawCertificateKey` it worked, with `certificateKey` no quic node would start. Also: the quic inbound now reads a SEC1 key -- "BEGIN EC PRIVATE KEY", what openssl hands out for an elliptic curve by default. The tls inbound has always taken one. That path has no test here; the harness's key is PKCS#8, and the asymmetry is plain enough between the two files.
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%
