opened
ORESoftware
username_0
I assume LWT is good for writing HTTP servers.
Is there a Github repo I can clone that has an example server which uses LWT to process HTTP requests concurrently?

I am looking to clone an example repo and get started using LWT with a simple HTTP server..that would be awesome.
Looking for showcase repo
issue
created
raphael-proust
username_1
https://github.com/mirage/ocaml-cohttp is an http server that can be used either with Lwt or with Async. To that end, the core of the code uses an abstract IO layer which can be instantiated with either Lwt or Async. It makes it a bit complicated as a starting point, but it still provides good reading material if you start with the approximation that [https://github.com/mirage/ocaml-cohttp/blob/master/cohttp/src/s.ml#L22](`IO`) is just a subset of Lwt.

https://github.com/ocsigen/ocsigenserver is a web server part of a larger project that provides a full set of web dev libraries and tools. The whole project is way beyond introductory experimentation, but the server itself might do.

https://opam.ocaml.org/packages/lwt/ has a list of projects that require or optionally depend on lwt. There are way too many of them for me to blurb them all; considering you mentioned HTTP, you might be interested in tlstunnel, telegraml, tcpip, or socket-daemon (to name a few).
comment
created
aantron
username_2
There are also examples in the httpaf repo, in particular this HTTP echo server: https://github.com/inhabitedtype/httpaf/blob/8a8cae44d978a121427eed9cfc09e234639bd605/examples/lwt/lwt_echo_server.ml.
comment
closed
aantron
username_2
issue