Open copy opened 7 years ago
Agreed. This is all caused by the fact that the server piece is heavily tied to conduit. Imo, we should have a simpler server layer that's based on Lwt_io.establish_server
and perhaps provide a direct callback that allows users to use whatever server implementation they want. Using a conduit server should be completely optional.
A usability issue: Setting the bind address and port of a
Cohttp_lwt_unix.Server
currently involves calling a function fromCohttp_lwt_unix.Client
, searchingConduit
and unnecessary lwt operations (at least for a TCP server). See below.Instead, a helper function
Cohttp_lwt_unix.Server.create_tcp : ?port:int -> ?bind_address:Ipaddr.t -> …
or similar should be provided.