diff --git a/tiny_httpd/Tiny_httpd/index.html b/tiny_httpd/Tiny_httpd/index.html index a72d3e7f..696f6f71 100644 --- a/tiny_httpd/Tiny_httpd/index.html +++ b/tiny_httpd/Tiny_httpd/index.html @@ -50,11 +50,12 @@ echo: Content-Length: 10 Content-Type: application/x-www-form-urlencoded; path="/echo"; body="howdy y'all"}
These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.
module Buf = Tiny_httpd_core.Bufmodule IO = Tiny_httpd_core.IOmodule Log = Tiny_httpd_core.Logmodule Util = Tiny_httpd_core.Utilmodule Pool = Tiny_httpd_core.Poolmodule Dir = Tiny_httpd_unix.Dirmodule type VFS = Tiny_httpd_unix.Dir.VFSmodule Html = Tiny_httpd_htmlAlias to Tiny_httpd_html
module Request = Tiny_httpd_core.Requestmodule Response = Tiny_httpd_core.Responsemodule Response_code = Tiny_httpd_core.Response_codemodule Route = Tiny_httpd_core.Routemodule Headers = Tiny_httpd_core.Headersmodule Meth = Tiny_httpd_core.Methmodule Server = Tiny_httpd_core.ServerException raised to exit request handlers with a code+error message
A middleware can be inserted in a handler to modify or observe its behavior.
module Middleware = Server.Middlewaremodule Head_middleware = Server.Head_middlewareA middleware that only considers the request's head+headers.
type t = Tiny_httpd_core.Server.tA HTTP server. See create for more details.
module type IO_BACKEND = Server.IO_BACKENDA backend that provides IO operations, network operations, etc.
val create_from :
+ ?enable_logging:bool ->
?buf_size:int ->
?middlewares:([ `Encoding | `Stage of int ] * Middleware.t) list ->
backend:(module IO_BACKEND) ->
unit ->
- tCreate 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 -> stringAddress on which the server listens.
val is_ipv6 : t -> boolis_ipv6 server returns true iff the address of the server is an IPv6 address.
val port : t -> intPort 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 -> intNumber of currently active connections.
val add_decode_request_cb :
+ tCreate 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 -> stringAddress on which the server listens.
val is_ipv6 : t -> boolis_ipv6 server returns true iff the address of the server is an IPv6 address.
val port : t -> intPort 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 -> intNumber of currently active connections.
val add_decode_request_cb :
t ->
(unit Tiny_httpd_core.Request.t ->
(unit Tiny_httpd_core.Request.t
@@ -114,6 +115,7 @@ echo:
('a, upgrade_handler) Tiny_httpd_core.Route.t ->
'a ->
unitval running : t -> boolIs the server running?
val stop : t -> unitAsk the server to stop. This might not have an immediate effect as run might currently be waiting on IO.
Run the main loop of the server, listening on a socket described at the server's creation time, using new_thread to start a thread for each new client.
This returns Ok () if the server exits gracefully, or Error e if it exits with an error.
val run_exn : ?after_init:(unit -> unit) -> t -> unitrun_exn s is like run s but re-raises an exception if the server exits with an error.
val create :
+ ?enable_logging:bool ->
?masksigpipe:bool ->
?max_connections:int ->
?timeout:float ->
@@ -125,4 +127,4 @@ echo:
?sock:Unix.file_descr ->
?middlewares:([ `Encoding | `Stage of int ] * Middleware.t) list ->
unit ->
- tCreate 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.