rkt_http 1.1.0

Types, traits, and parsers for HTTP requests, responses, and headers.
Documentation

rkt

Build Status Current Crates.io Version Minimum Rust Version

rkt is an async web framework for Rust with a focus on usability, security, extensibility, and speed.

#[macro_use] extern crate rkt;

#[get("/<name>/<age>")]
fn hello(name: &str, age: u8) -> String {
    format!("Hello, {} year old named {}!", age, name)
}

#[launch]
fn rocket() -> _ {
    rkt::build().mount("/hello", routes![hello])
}

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:

[dependencies]
rkt = "1.1.0"

Crates

Crate Description Docs
rkt Core framework docs.rs
rkt_dyn_templates Dynamic template rendering (Tera, Handlebars, MiniJinja) docs.rs
rkt_ws WebSocket support docs.rs

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 tracing ecosystem
  • 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:

cd examples/hello
cargo run

Getting Help

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request. You can also help by:

  1. Reporting bugs or requesting features via issues
  2. Improving documentation
  3. 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:

Any contribution you submit will be dual-licensed under the same terms, unless you explicitly state otherwise.