# \[ANN\] http\_async 0.2.0

**URL:** <https://discuss.ocaml.org/t/ann-http-async-0-2-0/10784>\
**Category:** Community\
**Tags:** announce\
**Created:** [November 11, 2022, 9:21pm UTC](https://discuss.ocaml.org/t/ann-http-async-0-2-0/10784 "2022-11-11T21:21:44Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![anuragsoni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/anuragsoni/32/1107_2.png) [@anuragsoni](https://discuss.ocaml.org/u/anuragsoni)\
**Post date:** [November 11, 2022, 9:21pm UTC](https://discuss.ocaml.org/t/ann-http-async-0-2-0/10784/1 "2022-11-11T21:21:44Z")

</div>

I’d like to announce the initial release of [http\_async](https://github.com/anuragsoni/http_async).

**Http\_async** : provides a HTTP/1.1 web server for [async](https://opensource.janestreet.com/async/).

The library started life as a wrapper around httpaf, but has evolved over time to be a standalone implementation of an HTTP/1.1 server. It implements its own parser that works on big strings and is reasonably fast. The library supports the common use-cases of connection pipelining, streaming request and response bodies. Servers can be run on both IP and Unix domain sockets, and ships with optional `Core.Command` entry points.

The implementation initially started as a testing ground for my I/o library [shuttle](https://github.com/anuragsoni/shuttle), but I’ve been happy enough with the resulting api that I intend to support this as a standalone library moving forward. As far as performance is concerned, I always recommend doing your own tests with workloads that are closer to the intended use, but in my tests the performance seems very reasonable. There is a version of http\_async that’s part of the http benchmarks run for the multicore project and the results looked fairly decent when compared to other single threaded runtimes (see [Replace shuttle with http-async by anuragsoni · Pull Request #24 · ocaml-multicore/retro-httpaf-bench · GitHub](https://github.com/ocaml-multicore/retro-httpaf-bench/pull/24) for more details)

### Hello World server

```ocaml
open! Core
open Async
open Http_async

let () =
  Command_unix.run
    (Server.run_command ~summary:"Hello world HTTP Server" (fun peer_addr _request ->
       return (Response.create `Ok, Body.Writer.string "Hello World")))
;;

```

The library doesn’t ship with any routers, or a middleware composition API with the intention that those will be layers that will live as a separate library. It should be easy to plug this into a third party routing library like `ocaml-dispatch` or `routes`. Some examples can be seen at: [http\_async/example at main · anuragsoni/http\_async · GitHub](https://github.com/anuragsoni/http_async/tree/main/example) and [http\_async/bench/server\_bench.ml at main · anuragsoni/http\_async · GitHub](https://github.com/anuragsoni/http_async/blob/main/bench/server_bench.ml) and documentation is available [online](https://anuragsoni.github.io/http_async/http_async/Http_async/index.html).

### Install

#### To use the version published on opam:

```auto
opam install http_async

```

#### For the development version:

```auto
opam pin add http_async.dev git+https://github.com/anuragsoni/http_async.git

```

If you try the library and experience any issues, or have further questions, please report an issue on the Github Issue tracker.

Thanks,  
Anurag

---

_[View the full topic](https://discuss.ocaml.org/t/ann-http-async-0-2-0/10784)._
