A high-performance, KDL-configured reverse proxy and web server built with Rust.
Gatel is a modern reverse proxy and web server inspired by Caddy, powered by Hyper and Tokio. It uses KDL as its configuration language, providing a clean and expressive way to define sites, routes, and middleware.
- KDL Configuration — Human-friendly config format with intuitive nesting
- Reverse Proxy — Weighted load balancing, health checks, passive health monitoring, and automatic retries
- TLS / ACME — Automatic HTTPS via ACME (Let's Encrypt), manual certificate support, and mTLS
- HTTP/1.1, HTTP/2, HTTP/3 — Full protocol support including QUIC-based HTTP/3
- Compression — Gzip, Zstd, and Brotli encoding
- Static File Serving — Efficient file server with configurable root directories
- Rate Limiting — Per-route request rate limiting
- Stream Proxy — TCP/UDP stream proxying
- Admin API — Runtime management endpoint
# Build
cargo build --release
# Run with a config file
gatel run --config gatel.kdlglobal {
http ":8080"
}
site "localhost" {
route "/*" {
respond "Hello from Gatel!" status=200
}
}global {
http ":80"
}
site "example.com" {
route "/api/*" {
proxy {
upstream "127.0.0.1:3001" weight=3
upstream "127.0.0.1:3002" weight=1
lb "weighted_round_robin"
health-check uri="/health" interval="10s"
}
}
route "/*" {
root "/var/www/html"
file-server
}
}See the docs/en directory for full English documentation, or docs/zh for Chinese documentation.
Licensed under the Apache License, Version 2.0. See LICENSE for details.