Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Async-tiny - minimal async HTTP server
I've released async_tiny, a minimal async HTTP server for Rust, inspired by tiny_http
. It is based on hyper
using the http1
and server
features and powered by tokio
. async_tiny
provides a fast async native alternative to blocking HTTP servers.
I made async_tiny
while building Velto, a web framework for Rust. Velto used to use tiny_http
, but it lacked async support and it wasn't really built for modern HTTP. I wanted to make an async and easy to use tiny_http
alternative so I made async_tiny
.
tokio
hyper
1.xuse async_tiny::Server;
#[tokio::main]
async fn main() -> std::io::Result<()> {
let mut server = Server::http("127.0.0.1:8080", true).await?;
println!("Listening on http://127.0.0.1:8080");
while let Some(request) = server.next().await {
let _ = request.respond("Hello");
}
Ok(())
}
async_tiny
is still in early release, but is used by Velto. I'd like any feedback or contributions.
1 post - 1 participant
🏷️ Rust_feed