Lwt: Looking for showcase repo

Created on 27 Jan 2019  路  2Comments  路  Source: ocsigen/lwt

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.

Most helpful comment

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 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).

All 2 comments

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 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).

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olafhering picture olafhering  路  8Comments

foretspaisibles picture foretspaisibles  路  8Comments

aantron picture aantron  路  9Comments

CraigFe picture CraigFe  路  8Comments

rdavison picture rdavison  路  7Comments