hooch_http
hooch_http is a lightweight, async HTTP server framework built on top of the hooch runtime. It provides fast HTTP parsing, simple route matching, and support for path/query parametersโall with zero allocations for request parsing.
โจ Features
- Fully async server built with
hooch - Request parsing with support for:
- HTTP/1.1
- Headers
- Request body
- Path and query parameter extraction
- Lightweight and minimal boilerplate
- Designed for low-latency use cases
๐ Example
use hooch_main;
use ;
async
async
๐งช Try it
Start the server:
Then, test it:
Console output:
PATH KEY: Key("mate")
PATH VALUE: Value("123")
QUERY KEY: Key("this")
QUERY VALUE: Some(Value("that"))
๐ฆ Installation
Add to your Cargo.toml:
[]
= "0.1"
= { = "./hooch_http" } # or use a Git repo if publishing externally
๐ Documentation
- Requests are parsed using efficient zero-copy logic.
- You can match URIs with placeholders like
/user/{id}. - Query strings are also parsed and exposed via
.iter_query().
๐ Safety
All unsafe blocks are carefully justified and used to optimize buffer reuse and lifetimes. No unsafe is used where avoidable.
๐ ๏ธ TODO
- Add support for middleware
- Routing table
- TLS support
- Request timeouts and keep-alive
๐ License
Apache-2.0
Happy hacking! ๐