package mirage-conduit

  1. Overview
  2. Docs

Functorial connection establishment interface that is compatible with the Mirage libraries.

Dynamic flows.

type callback = Flow.flow -> unit Lwt.t

The type for callback values.

module type Handler = sig ... end

The signature for runtime handlers

TCP

The type for client connections.

type tcp_client = [
  1. | `TCP of Ipaddr.t * int
]

address and destination port

and tcp_server = [
  1. | `TCP of int
]

address and destination port

listening port

type 'a stackv4
val stackv4 : (module Mirage_stack_lwt.V4 with type t = 'a) -> 'a stackv4

VCHAN

type vchan_client = [
  1. | `Vchan of [ `Direct of int * Vchan.Port.t | `Domain_socket of string * Vchan.Port.t ]
]
type vchan_server = [
  1. | `Vchan of [ `Direct of int * Vchan.Port.t | `Domain_socket ]
]
module type VCHAN = Vchan.S.ENDPOINT with type port = Vchan.Port.t
module type XS = Xs_client_lwt.S
type vchan
type xs
val vchan : (module VCHAN) -> vchan
val xs : (module XS) -> xs

TLS

type 'a tls_client = [
  1. | `TLS of Tls.Config.client * 'a
]
type 'a tls_server = [
  1. | `TLS of Tls.Config.server * 'a
]

The type for client configuration values.

val sexp_of_client : client -> Ppx_sexp_conv_lib.Sexp.t
val client_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> client
val __client_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> client

The type for server configuration values.

val sexp_of_server : server -> Ppx_sexp_conv_lib.Sexp.t
val server_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> server
val __server_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> server
val client : Conduit.endp -> client Lwt.t

Resolve a conduit endpoint into a client configuration.

val server : Conduit.endp -> server Lwt.t

Resolve a confuit endpoint into a server configuration.

type conduit

The type for conduit values.

module type S = sig ... end

The signature for Conduit implementations.

include S
type t = conduit
val empty : t

The empty conduit.

module With_tcp (S : Mirage_stack_lwt.V4) : sig ... end
val with_tcp : t -> 'a stackv4 -> 'a -> t Lwt.t

Extend a conduit with an implementation for TCP.

val with_tls : t -> t Lwt.t

Extend a conduit with an implementation for TLS.

val with_vchan : t -> xs -> vchan -> string -> t Lwt.t

Extend a conduit with an implementation for VCHAN.

val connect : t -> client -> Flow.flow Lwt.t

Connect a conduit using a client configuration value.

val listen : t -> server -> callback -> unit Lwt.t

Configure a server using a conduit configuration value.

module Context (T : Mirage_time_lwt.S) (S : Mirage_stack_lwt.V4) : sig ... end
OCaml

Innovation. Community. Security.