rkt
rkt is an async web framework for Rust with a focus on usability, security, extensibility, and speed.
extern crate rkt;
Visiting localhost:8000/hello/John/58 will trigger the hello route, returning
Hello, 58 year old named John!. If <age> can't be parsed as a u8, the route
won't be called and a 404 is returned automatically.
rkt is a community-maintained continuation of Rocket, the Rust web framework originally created by Sergio Benitez and the Rocket contributors. We are deeply grateful for their foundational work — rkt would not exist without it. The original project remains available at github.com/rwf2/Rocket.
Getting Started
Add rkt to your Cargo.toml:
[]
= "1.1.0"
Crates
| Crate | Description | Docs |
|---|---|---|
rkt |
Core framework | |
rkt_dyn_templates |
Dynamic template rendering (Tera, Handlebars, MiniJinja) | |
rkt_ws |
WebSocket support |
Features
- HTTP/1.1 & HTTP/2 — built on Hyper
- HTTP/3 preview — via s2n-quic (enable with
http3-preview) - TLS & mTLS — via Rustls (enable with
tls/mtls) - Secret cookies — signed and encrypted cookie support (enable with
secrets) - WebSockets — first-class support via
rkt_ws - Dynamic templates — Tera, Handlebars, and MiniJinja via
rkt_dyn_templates - Tracing — structured logging via the
tracingecosystem - Type-safe routing — compile-time checked routes, guards, and responders
- Extensible — fairings, request guards, and custom responders
Documentation
- Guide — detailed reference covering all features
- API Docs — full rustdoc reference
- Examples — runnable example projects in this repo
Examples
Each subdirectory under examples/ is a self-contained Cargo crate.
To run one:
Getting Help
- Open a GitHub Discussion for questions
- File a bug report or feature request
Contributing
Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request. You can also help by:
- Reporting bugs or requesting features via issues
- Improving documentation
- Sharing projects built with rkt in Show & Tell
Acknowledgements
rkt is built on the shoulders of the Rocket project. Sincere thanks to Sergio Benitez for creating Rocket and to all past and present Rocket contributors for the work that makes this framework possible.
License
rkt is dual-licensed under your choice of:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
Any contribution you submit will be dual-licensed under the same terms, unless you explicitly state otherwise.