Module Simple_httpd.AddressSource

Module for declaring address and port to listen to

Module for declaring address and port to listen to

Sourcetype index = private int

A type to index all listened addresses

Sourcetype t = private {
  1. addr : string;
    (*

    The actual address in format "0.0.0.0"

    *)
  2. port : int;
    (*

    The port

    *)
  3. hosts : string list;
    (*

    The host we accept: any if the list is empty, only those listed otherwise

    *)
  4. ssl : Ssl.context option;
    (*

    An optional ssl context

    *)
  5. reuse : bool;
    (*

    Can we reuse the socket

    *)
  6. mutable index : index ref;
    (*

    The index used to refer to the address, shared by all addresses with the same IP and port

    *)
}

Record type storing an address we listen on

Sourcetype ssl_info = {
  1. protocol : Ssl.protocol;
    (*

    minimum protocol to use, max is TSL1.3

    *)
  2. cert : string;
    (*

    file name of the certificate

    *)
  3. priv : string;
    (*

    file name of the private key

    *)
  4. ktls : bool;
    (*

    use kernel TLS. Remark; Rx only available with openSSL >= 3.1. Check if suppoprted by each client before using

    *)
}

type givent the relevant information for a ssl certificate

Sourceval make : ?addr:string -> ?port:int -> ?hosts:string list -> ?ssl:ssl_info -> ?reuse:bool -> unit -> t

The constructor to build an address

Sourceval change_hosts : string list -> t -> t

Functions to reuse the same address and ssl certificate with a different port or hosts.

Sourceval change_port : int -> t -> t
Sourceval set_ssl_reload_period : int -> unit

set the period in seconds at which all ssl certificates are checked for renewal (default 1 day)