httprs is a lightweight HTTP server.
It aims to provide predictable HTTP server behavior without requiring external runtimes like tokio or async-std.
cargo build --release
Run
```sh
./target/release/httprs \
--host 127.0.0.1 \
--port 8080 \
--worker 4 \
--timeout-ms 2000 \
--max-header-size 8192This command starts a HTTP server listening on 127.0.0.1:8080 with 4 preforked worker processes and a 2‑second accept timeout.
- Custom Handler – Implement the
Handlertrait and pass it toHttp1::new(). - Custom Process – Implement the
Processtrait (e.g., a WebSocket server). - Worker Customization – Replace
TcpWorkerwith a UDP worker or add TLS support.
Run the test suite with:
cargo testTests cover:
- URL parsing (
http/http.rs) - Echo server logic (
process/echo.rs) - Worker manager integration (
worker/manager.rs)