Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Very lightweight HTTP server using Lwt or Async
OCaml JavaScript Other

This branch is even with mirage:cookie-max-age

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
async
bin
cohttp
lib_test
lwt
scripts
.gitignore
.merlin
.travis-ci.sh
.travis.yml
CHANGES
LICENSE
Makefile
README.md
TODO.md
_oasis
_tags
myocamlbuild.ml
setup.ml

README.md

CoHTTP is an OCaml library for creating HTTP daemons. It has a portable HTTP parser, and implementations using various asynchronous programming libraries:

  • Cohttp_lwt_unix uses the Lwt library, and specifically the UNIX bindings.
  • Cohttp_async uses the Async library.
  • Cohttp_lwt exposes an OS-independent Lwt interface, which is used by the the Mirage interface to generate standalone microkernels (see the xen and unix respectively).

You can implement other targets using the parser very easily. Look at the lib/IO.mli signature and implement that in the desired backend.

You can activate some runtime debugging by setting COHTTP_DEBUG to any value, and all requests and responses will be written to stderr.

For build requirements, please see the _oasis file, or use OPAM to install it from http://github.com/ocaml/opam.

Simple HTTP server

If you install the Async dependency, then a cohttp-server binary will also be built and installed that acts in a similar fashion to the Python SimpleHTTPServer. Just run cohttp-server in a directory and it will open up a local port and serve the files over HTTP.

Something went wrong with that request. Please try again.