7 releases (breaking)

0.7.0 Feb 3, 2025
0.6.0 Jan 27, 2025
0.5.0 Jan 20, 2025
0.4.0 Jan 20, 2025
0.1.0 Nov 26, 2024

#487 in HTTP server

MIT license

135KB
2.5K SLoC

claro

⚠️ Work in progress ...

A simple, predictable HTTP/1.1 server

Hello world

use claro::{Response, Request};

let (server, shutdown_handle) = claro::listen("localhost:0", |_: &mut Request| {
    Response::plain_text("Hello, world!")
}).unwrap();

// use server.wait() to block until the server terminates
shutdown_handle.stop();

This library will be interesting to you if any of the following describe you:

  • You need a simple http server for your static site generator.
  • You are going to be putting your service behind a reverse proxy, so it does not need to speak anythinmg other than http/1.1
  • You despair at the lack of maintained non-async http servers in the Rust ecosystem.

Turn around if:

  • You expect that what your are building will need to maintain a "high" number of concurrent connections (what "high" here means is TBD).

Dependencies

~4–11MB
~97K SLoC