package cohttp-lwt-unix

  1. Overview
  2. Docs

Basic satisfaction of Cohttp_lwt.Net

type ctx = {
  1. ctx : Conduit_lwt_unix.ctx;
  2. resolver : Resolver_lwt.t;
}
include Cohttp_lwt.S.Net with module IO = Cohttp_lwt_unix__.Io and type ctx := ctx and type endp = Conduit.endp
module IO : sig ... end
type endp = Conduit.endp
val sexp_of_ctx : ctx -> Ppx_sexp_conv_lib.Sexp.t
val default_ctx : ctx
val resolve : ctx:ctx -> Uri.t -> endp IO.t
val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t
val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t
val close_in : IO.ic -> unit
val close_out : IO.oc -> unit
val close : IO.ic -> IO.oc -> unit
val init : ?ctx:Conduit_lwt_unix.ctx -> ?resolver:Resolver_lwt.t -> unit -> ctx

init ?ctx ?resolver () is a network context that is the same as the default_ctx, but with either the connection handling or resolution module overridden with ctx or resolver respectively. This is useful to supply a Conduit_lwt_unix.resolver with a custom source network interface, or a Resolver_lwt.t with a different name resolution strategy (for instance to override a hostname to point it to a Unix domain socket).

OCaml

Innovation. Community. Security.