3 releases (breaking)
0.3.0 | Dec 16, 2024 |
---|---|
0.2.0 | Nov 30, 2024 |
0.1.0 | Nov 26, 2024 |
#213 in HTTP server
154 downloads per month
135KB
2.5K
SLoC
claro
⚠️ Work in progress ...
A simple, predictable HTTP/1.1 server
Hello world
use claro::{Response, Request};
let server = claro::listen("localhost:0", |_: &mut Request| {
Response::plain_text("Hello, world!")
}).unwrap();
// use server.wait() to block until the server terminates
server.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.
- See also:
file-serve
- See also:
- 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
~103K SLoC