type 'a io = 'a Lwt.t
Abstract type of the cooperative threading library used, normally defined via the
IO module type
type svc = Resolver.service
Abstract type for a service entry, which maps a URI scheme into a protocol handler and TCP port
A rewrite function resolves a service and a URI into a concrete endpoint.
f ++ g is the composition of the service functions
init ?service ?rewrites will initialize the resolver and return a state handler. The service argument should contain the system-specific resolution mechanism for URI schemas.
rewrites argument can optionally override a subset of the URI domain name with the given
rewrite_fn to permit custom resolution rules. For example, a rewrite rule for ".xen" would let the rewrite function resolve hostnames such as "foo.xen" into a shared memory channel for the "foo" virtual machine.
add_rewrite ~host f t will add to the
t resolver the
f rewrite rule for all the domain names that shortest-prefix match
service t is the function which is called when trying to resolve a hostname with
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
127.0.0.1, and fails on all other hostnames.