Registry / networking / async-h1

async-h1

JSON →
library2.3.4rscratesunverified

Asynchronous HTTP/1.1 parser for Rust.

# Cargo.toml [dependencies] async-h1 = "2.3.4"
INSTALL
IMPORT
SIG · ASYNC-H1
A
async-h1
networkingrustv2.3.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Server
use async_h1::Server;

Starts an async HTTP/1.1 server that responds to requests.

use async_h1::Server; use async_std::net::TcpListener; use async_std::prelude::*; fn main() -> Result<(), Box<dyn std::error::Error>> { async_std::task::block_on(async { let listener = TcpListener::bind("127.0.0.1:8080").await?; let mut incoming = listener.incoming(); while let Some(stream) = incoming.next().await { let stream = stream?; async_std::task::spawn(async { Server::new().respond(stream).await.unwrap(); }); } Ok(()) }) }
Debug
Known issues
gotchaRequires an async runtime like async-std or tokio.
fix
Add async-std or tokio as a dependency and use appropriate executor.
affects: >=2.0.0
Upgrade
Version history
2.3.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
53 hits · last 30 days
node
44
OpenAI (training)
1
Resources
async-h1 — cargo add async-h1 · libregistry