diff --git a/tiny_httpd/Tiny_httpd/index.html b/tiny_httpd/Tiny_httpd/index.html index 1ef1617e..c77babca 100644 --- a/tiny_httpd/Tiny_httpd/index.html +++ b/tiny_httpd/Tiny_httpd/index.html @@ -58,7 +58,7 @@ echo: ?middlewares:([ `Encoding | `Stage of int ] * Middleware.t) list -> backend:(module IO_BACKEND) -> unit -> - t

Create a new webserver using provided backend.

The server will not do anything until run is called on it. Before starting the server, one can use add_path_handler and set_top_handler to specify how to handle incoming requests.

val addr : t -> string

Address on which the server listens.

val is_ipv6 : t -> bool

is_ipv6 server returns true iff the address of the server is an IPv6 address.

val port : t -> int

Port on which the server listens. Note that this might be different than the port initially given if the port was 0 (meaning that the OS picks a port for us).

val active_connections : t -> int

Number of currently active connections.

val add_decode_request_cb : + t

Create a new webserver using provided backend.

The server will not do anything until run is called on it. Before starting the server, one can use add_path_handler and set_top_handler to specify how to handle incoming requests.

val addr : t -> string

Address on which the server listens.

val is_ipv6 : t -> bool

is_ipv6 server returns true iff the address of the server is an IPv6 address.

val port : t -> int

Port on which the server listens. Note that this might be different than the port initially given if the port was 0 (meaning that the OS picks a port for us).

val active_connections : t -> int

Number of currently active connections.

val add_decode_request_cb : t -> (unit Tiny_httpd_core.Request.t -> (unit Tiny_httpd_core.Request.t @@ -74,7 +74,7 @@ echo: stage:[ `Encoding | `Stage of int ] -> t -> Middleware.t -> - unit

Add a middleware to every request/response pair.

val add_head_middleware : t -> Head_middleware.t -> unit

Add a request-header only Head_middleware.t. This is called on requests, to modify them, and returns a new request immediately.

Request handlers
val set_top_handler : + unit

Add a middleware to every request/response pair.

val add_head_middleware : t -> Head_middleware.t -> unit

Add a request-header only Head_middleware.t. This is called on requests, to modify them, and returns a new request immediately.

Request handlers
val set_top_handler : t -> (Tiny_httpd_core.IO.Input.t Tiny_httpd_core.Request.t -> Tiny_httpd_core.Response.t) -> @@ -131,4 +131,4 @@ echo: ?head_middlewares:Head_middleware.t list -> ?middlewares:([ `Encoding | `Stage of int ] * Middleware.t) list -> unit -> - t

Create a new webserver using UNIX abstractions.

The server will not do anything until run is called on it. Before starting the server, one can use add_path_handler and set_top_handler to specify how to handle incoming requests.

+ t

Create a new webserver using UNIX abstractions.

The server will not do anything until run is called on it. Before starting the server, one can use add_path_handler and set_top_handler to specify how to handle incoming requests.

diff --git a/tiny_httpd/Tiny_httpd_core/Log/index.html b/tiny_httpd/Tiny_httpd_core/Log/index.html index afca0f07..acb48ce6 100644 --- a/tiny_httpd/Tiny_httpd_core/Log/index.html +++ b/tiny_httpd/Tiny_httpd_core/Log/index.html @@ -5,4 +5,4 @@ ((('a, Stdlib.Format.formatter, unit, unit) format4 -> 'a) -> unit) -> unit
val error : ((('a, Stdlib.Format.formatter, unit, unit) format4 -> 'a) -> unit) -> - unit
val setup : debug:bool -> unit -> unit

Setup and enable logging. This should only ever be used in executables, not libraries.

val dummy : bool
val fully_disable : unit -> unit

Totally silence logs for tiny_httpd. With Logs installed this means setting the level of the tiny_httpd source to None.

+ unit
val setup : debug:bool -> unit -> unit

Setup and enable logging. This should only ever be used in executables, not libraries.

val dummy : bool
val fully_disable : unit -> unit

Totally silence logs for tiny_httpd. With Logs installed this means setting the level of the tiny_httpd source to None.

diff --git a/tiny_httpd/Tiny_httpd_core/Response/index.html b/tiny_httpd/Tiny_httpd_core/Response/index.html index 2c8b86ec..6dffbcad 100644 --- a/tiny_httpd/Tiny_httpd_core/Response/index.html +++ b/tiny_httpd/Tiny_httpd_core/Response/index.html @@ -30,4 +30,4 @@ unit -> Stdlib.Format.formatter -> t -> - unit

Pretty print the response. The exact format of this printing is not specified.

val pp : Stdlib.Format.formatter -> t -> unit

Pretty print the response. The exact format is not specified.

+ unit

Pretty print the response. The exact format of this printing is not specified.

val pp : Stdlib.Format.formatter -> t -> unit

Pretty print the response. The exact format is not specified.

diff --git a/tiny_httpd/Tiny_httpd_core/Server/index.html b/tiny_httpd/Tiny_httpd_core/Server/index.html index 873c0bec..6318a124 100644 --- a/tiny_httpd/Tiny_httpd_core/Server/index.html +++ b/tiny_httpd/Tiny_httpd_core/Server/index.html @@ -6,7 +6,7 @@ ?middlewares:([ `Encoding | `Stage of int ] * Middleware.t) list -> backend:(module IO_BACKEND) -> unit -> - t

Create a new webserver using provided backend.

The server will not do anything until run is called on it. Before starting the server, one can use add_path_handler and set_top_handler to specify how to handle incoming requests.

val addr : t -> string

Address on which the server listens.

val is_ipv6 : t -> bool

is_ipv6 server returns true iff the address of the server is an IPv6 address.

val port : t -> int

Port on which the server listens. Note that this might be different than the port initially given if the port was 0 (meaning that the OS picks a port for us).

val active_connections : t -> int

Number of currently active connections.

val add_decode_request_cb : + t

Create a new webserver using provided backend.

The server will not do anything until run is called on it. Before starting the server, one can use add_path_handler and set_top_handler to specify how to handle incoming requests.

val addr : t -> string

Address on which the server listens.

val is_ipv6 : t -> bool

is_ipv6 server returns true iff the address of the server is an IPv6 address.

val port : t -> int

Port on which the server listens. Note that this might be different than the port initially given if the port was 0 (meaning that the OS picks a port for us).

val active_connections : t -> int

Number of currently active connections.

val add_decode_request_cb : t -> (unit Request.t -> (unit Request.t * (IO.Input.t -> IO.Input.t)) option) -> unit

Add a callback for every request. The callback can provide a stream transformer and a new request (with modified headers, typically). A possible use is to handle decompression by looking for a Transfer-Encoding header and returning a stream transformer that decompresses on the fly.

val add_encode_response_cb : @@ -16,7 +16,7 @@ stage:[ `Encoding | `Stage of int ] -> t -> Middleware.t -> - unit

Add a middleware to every request/response pair.

val add_head_middleware : t -> Head_middleware.t -> unit

Add a request-header only Head_middleware.t. This is called on requests, to modify them, and returns a new request immediately.

Request handlers

val set_top_handler : t -> (IO.Input.t Request.t -> Response.t) -> unit

Setup a handler called by default.

This handler is called with any request not accepted by any handler installed via add_path_handler. If no top handler is installed, unhandled paths will return a 404 not found

This used to take a string Request.t but it now takes a byte_stream Request.t since 0.14 . Use Request.read_body_full to read the body into a string if needed.

val add_route_handler : + unit

Add a middleware to every request/response pair.

val add_head_middleware : t -> Head_middleware.t -> unit

Add a request-header only Head_middleware.t. This is called on requests, to modify them, and returns a new request immediately.

Request handlers

val set_top_handler : t -> (IO.Input.t Request.t -> Response.t) -> unit

Setup a handler called by default.

This handler is called with any request not accepted by any handler installed via add_path_handler. If no top handler is installed, unhandled paths will return a 404 not found

This used to take a string Request.t but it now takes a byte_stream Request.t since 0.14 . Use Request.read_body_full to read the body into a string if needed.

val add_route_handler : ?accept:(unit Request.t -> (unit, Response_code.t * string) result) -> ?middlewares:Middleware.t list -> ?meth:Meth.t ->