A high-performance, memory-efficient, and scalable HTTP/1.1 web server for OCaml, built with Angstrom and Faraday.
http/af is a web server library for OCaml that implements HTTP/1.1 with a focus on high performance, memory efficiency, and scalability. It solves issues like poor scheduling and excessive allocation found in other OCaml HTTP servers by providing a portable, IO-agnostic state machine for parsing and serialization.
OCaml developers building high-throughput web services, backend systems, or applications requiring efficient HTTP handling, especially those using Async or Lwt runtimes.
Developers choose http/af for its superior performance and scalability compared to alternatives like cohttp, its memory efficiency, and its portable design that decouples HTTP logic from IO, allowing flexible runtime integration.
A high performance, memory efficient, and scalable web server written in OCaml
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Addresses cohttp's poor scheduling and allocation issues, with benchmark data showing flat latency histograms and high request throughput under load, as highlighted in the README comparison.
Minimizes allocations and optimizes resource usage, making it suitable for sustained high-throughput applications without excessive memory overhead.
Decouples HTTP logic from IO mechanisms, allowing seamless integration with Async, Lwt, or other runtimes, as demonstrated in the provided examples.
Implements HTTP/1.1 parsing, serialization, and pipelining as a portable state machine using robust libraries like Angstrom and Faraday, ensuring correctness.
Does not support HTTP/2 or other modern HTTP versions, which may be a dealbreaker for applications requiring newer protocol features or improved performance.
Requires developers to build higher-level features like routing, middleware, and error handling from scratch, adding development overhead compared to more integrated frameworks.
Heavily relies on OCaml tooling (e.g., OPAM) and runtime knowledge, making it inaccessible for teams not already invested in the OCaml ecosystem or seeking cross-language solutions.
httpaf is an open-source alternative to the following products: