PulseHTTP
Async HTTP/1.1 framework for Rust, built on Tokio from raw TCP sockets
Install
[]
= "0.1"
= { = "1", = ["full"] }
Quick start
use ;
async
Ctrl+C triggers graceful shutdown (stop accept → drain connections → grace abort).
Features (v0.1)
- Tokio TCP listener, task-per-connection, admission semaphore
- HTTP/1.1 keep-alive,
Content-Lengthbodies, read timeouts - Trie router (static +
:param), query params - Async middleware (request id, logging, CORS, security headers, panic catch)
- JSON +
application/x-www-form-urlencoded - Typed app
State - Per-route token-bucket rate limits
- Configurable max connections, max body size, read timeout
- Graceful shutdown
Examples
From this repo:
# routing, JSON, forms — no database
# per-route rate limiting (429 after burst)
# typed State + Postgres (sqlx)
| Example | Port | Focus |
|---|---|---|
hello_world |
3000 | Basics |
sqlx_postgres |
3001 | State + DB |
rate_limit |
3002 | Route limits |
Builder knobs
bind
.await
.max_connects
.max_body_size
.read_timeout_sec
.router
.serve
.await;
Not in v0.1 (later)
Chunked transfer encoding, multipart uploads, streaming responses, write timeouts, fuzz tests, benchmarks.
License
MIT