package conduit-mirage

  1. Overview
  2. Docs

Provides a DNS-enabled Resolver_lwt given a network stack.

Parameters

module R : Mirage_random.S
module T : Mirage_time.S
module C : Mirage_clock.MCLOCK

Signature

include S
include Resolver_lwt.S
type 'a io = 'a Lwt.t
type t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
type svc = Resolver.service
val sexp_of_svc : svc -> Sexplib0.Sexp.t
val svc_of_sexp : Sexplib0.Sexp.t -> svc
type rewrite_fn = svc -> Uri.t -> Conduit.endp io
type service_fn = string -> svc option io
val init : ?service:service_fn -> ?rewrites:(string * rewrite_fn) list -> unit -> t
val add_rewrite : host:string -> f:rewrite_fn -> t -> unit
val set_service : f:service_fn -> t -> unit
val service : t -> service_fn
val resolve_uri : ?rewrites:(string * rewrite_fn) list -> uri:Uri.t -> t -> Conduit.endp io
val static : (string, port:int -> Conduit.endp) Stdlib.Hashtbl.t -> t

static hosts constructs a resolver that looks up any resolution requests from the static hosts hashtable instead of using the system resolver.

val localhost : t

localhost is a static resolver that has a single entry that maps localhost to 127.0.0.1, and fails on all other hostnames.

val v : ?ns:Ipaddr.t -> ?ns_port:int -> S.t -> t

v ?ns ?ns_port ?stack () TODO

OCaml

Innovation. Community. Security.