Repository navigation
v0.2.0
Minor release with major improvements to the HTTP server, full IPv6 support, cookies, hardened WebSocket, and extensive testing and fuzzing.
Highlights
HTTP server (rewrite)
- Buffered 8KB chunk reads (no more 1-byte loops).
- HTTP/1.1 keep-alive with
max_keepalive_requestsandidle_timeout_mscontrols; HTTP/1.0 aware. - Recv/send timeouts via
SO_RCVTIMEO/SO_SNDTIMEO. - Configurable
max_uri_length,max_header_bytes,max_body_bytes. - RFC 7230 token validation for methods and header names.
- Response helpers:
ok,ok_json,not_found,bad_request,internal_error, etc. - Accurate
Connection: closesemantics andContent-Lengthhandling.
IPv6
- Full IPv6 wire support (
AF_INET6listeners, connects,sockaddr_in6packing). - Dual-stack DNS with automatic fallback:
resolve()returns both A and AAAA records and_connect_with_fallback()iterates through them with per-address timeouts. - IPv6 loopback probes in tests to skip gracefully on environments without IPv6 loopback.
Cookies (new module)
Cookie,CookieJar,SameSiteenum.parse_cookie_headerandparse_set_cookie_headerwith attribute support (Path,Domain,Max-Age,Expires,Secure,HttpOnly,SameSite).- Fuzz-tested (200k runs per harness).
WebSocket hardening
- CSPRNG nonce from
/dev/urandom(no PRNG guessable). - Text-frame UTF-8 validation per RFC 6455 — invalid sequences raise
WsProtocolError.
Performance
- Zero-copy header line parsing.
- Eliminated
_lower_keysand replaced with inline case-insensitive comparison (_eq_icase). - Faster
HeaderMapwithset_uncheckedandencode_to.
Bug fixes
- NUL byte crash in HTTP response parser.
- Various compiler warning cleanups across tests and source.
Testing and fuzzing
- 260+ unit tests covering TCP, UDP, TLS, HTTP, WebSocket, DNS, net, ergonomics, server, and cookies.
- Fuzz harnesses: 200k runs each for headers, HTTP response, HTTP server, URL, WebSocket client, WebSocket server, cookies.
- Format check step added to CI.
Benchmarking
- Microbenchmarks for header encode/parse.
wrk-compatible HTTP server benchmark with a driver script.- Benchmarks now run with
idle_timeout_ms=0andwrite_timeout_ms=0for maximum throughput.
Dependencies
mojopinned to==0.26.3.0.dev2026041520(pixi dep and rattler recipe).jsonpinned to tagv0.1.1(pixi dep and rattler source).
Installation
[dependencies]
flare = { git = "https://github.com/ehsanmok/flare.git", tag = "v0.2.0" }Upgrade notes
No breaking public API changes vs v0.1.0, but the HTTP server config has new fields with sensible defaults. If you construct ServerConfig manually, review the new knobs (idle_timeout_ms, write_timeout_ms, max_keepalive_requests, max_uri_length).