From 97661b2cc25a23d1834b41963c52cd18da3d4711 Mon Sep 17 00:00:00 2001 From: c-cube Date: Wed, 24 May 2023 20:12:02 +0000 Subject: [PATCH] deploy: 493855e57b14f45c6b93c47c57da12bcccb494a5 --- dev/index.html | 4 ++-- dev/tiny_httpd/Tiny_httpd/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_html_/A/index.html | 2 -- dev/tiny_httpd/Tiny_httpd_html_/Out/index.html | 2 -- dev/tiny_httpd/Tiny_httpd_server/Response/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/index.html | 4 ++-- 6 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 dev/tiny_httpd/Tiny_httpd_html_/A/index.html delete mode 100644 dev/tiny_httpd/Tiny_httpd_html_/Out/index.html diff --git a/dev/index.html b/dev/index.html index 2a56ec32..9e380f8b 100644 --- a/dev/index.html +++ b/dev/index.html @@ -11,8 +11,8 @@

OCaml package documentation

    -
  1. tiny_httpd 0.12
  2. -
  3. tiny_httpd_camlzip 0.12
  4. +
  5. tiny_httpd 0.13
  6. +
  7. tiny_httpd_camlzip 0.13
diff --git a/dev/tiny_httpd/Tiny_httpd/index.html b/dev/tiny_httpd/Tiny_httpd/index.html index 21c4694f..a4a0a4e4 100644 --- a/dev/tiny_httpd/Tiny_httpd/index.html +++ b/dev/tiny_httpd/Tiny_httpd/index.html @@ -90,4 +90,4 @@ echo: t -> ('a, string Request.t -> server_sent_generator -> unit) Route.t -> 'a -> - unit

Add a handler on an endpoint, that serves server-sent events.

The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.

This handler stays on the original thread (it is synchronous).

Run the server
val stop : t -> unit

Ask the server to stop. This might not have an immediate effect as run might currently be waiting on IO.

val run : ?after_init:(unit -> unit) -> t -> (unit, exn) Stdlib.result

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.

  • parameter after_init

    is called after the server starts listening. since NEXT_RELEASE .

Utils

module Util = Tiny_httpd_util

Static directory serving

module Dir = Tiny_httpd_dir
module Html = Tiny_httpd_html
\ No newline at end of file + unit

Add a handler on an endpoint, that serves server-sent events.

The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.

This handler stays on the original thread (it is synchronous).

Run the server
val stop : t -> unit

Ask the server to stop. This might not have an immediate effect as run might currently be waiting on IO.

val run : ?after_init:(unit -> unit) -> t -> (unit, exn) Stdlib.result

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.

  • parameter after_init

    is called after the server starts listening. since 0.13 .

Utils

module Util = Tiny_httpd_util

Static directory serving

module Dir = Tiny_httpd_dir
module Html = Tiny_httpd_html
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html_/A/index.html b/dev/tiny_httpd/Tiny_httpd_html_/A/index.html deleted file mode 100644 index 53a1b44d..00000000 --- a/dev/tiny_httpd/Tiny_httpd_html_/A/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -A (tiny_httpd.Tiny_httpd_html_.A)

Module Tiny_httpd_html_.A

Attributes.

This module contains combinator for the standard attributes. One can also just use a pair of strings.

type t = string -> attribute

Attribute builder

val accept : t

Attribute "accept".

val accept_charset : t

Attribute "accept-charset".

val accesskey : t

Attribute "accesskey".

val action : t

Attribute "action".

val align : t

Attribute "align".

val allow : t

Attribute "allow".

val alt : t

Attribute "alt".

val async : t

Attribute "async".

val autocapitalize : t

Attribute "autocapitalize".

val autocomplete : t

Attribute "autocomplete".

val autofocus : t

Attribute "autofocus".

val autoplay : t

Attribute "autoplay".

val buffered : t

Attribute "buffered".

val capture : t

Attribute "capture".

val challenge : t

Attribute "challenge".

val charset : t

Attribute "charset".

val checked : t

Attribute "checked".

val cite : t

Attribute "cite".

val class_ : t

Attribute "class".

val code : t

Attribute "code".

val codebase : t

Attribute "codebase".

val cols : t

Attribute "cols".

val colspan : t

Attribute "colspan".

val content : t

Attribute "content".

val contenteditable : t

Attribute "contenteditable".

val contextmenu : t

Attribute "contextmenu".

val controls : t

Attribute "controls".

val coords : t

Attribute "coords".

val crossorigin : t

Attribute "crossorigin".

val csp : t

Attribute "csp".

val data : t

Attribute "data".

val data_star : t

Attribute "data-*".

val datetime : t

Attribute "datetime".

val decoding : t

Attribute "decoding".

val default : t

Attribute "default".

val defer : t

Attribute "defer".

val dir : t

Attribute "dir".

val dirname : t

Attribute "dirname".

val disabled : t

Attribute "disabled".

val download : t

Attribute "download".

val draggable : t

Attribute "draggable".

val enctype : t

Attribute "enctype".

val enterkeyhint : t

Attribute "enterkeyhint".

val for_ : t

Attribute "for".

val form : t

Attribute "form".

val formaction : t

Attribute "formaction".

val formenctype : t

Attribute "formenctype".

val formmethod : t

Attribute "formmethod".

val formnovalidate : t

Attribute "formnovalidate".

val formtarget : t

Attribute "formtarget".

val headers : t

Attribute "headers".

val hidden : t

Attribute "hidden".

val high : t

Attribute "high".

val href : t

Attribute "href".

val hreflang : t

Attribute "hreflang".

val http_equiv : t

Attribute "http-equiv".

val icon : t

Attribute "icon".

val id : t

Attribute "id".

val importance : t

Attribute "importance".

val integrity : t

Attribute "integrity".

val ismap : t

Attribute "ismap".

val itemprop : t

Attribute "itemprop".

val keytype : t

Attribute "keytype".

val kind : t

Attribute "kind".

val label : t

Attribute "label".

val lang : t

Attribute "lang".

val language : t

Attribute "language".

val list : t

Attribute "list".

val loop : t

Attribute "loop".

val low : t

Attribute "low".

val manifest : t

Attribute "manifest".

val max : t

Attribute "max".

val maxlength : t

Attribute "maxlength".

val minlength : t

Attribute "minlength".

val media : t

Attribute "media".

val method_ : t

Attribute "method".

val min : t

Attribute "min".

val multiple : t

Attribute "multiple".

val muted : t

Attribute "muted".

val name : t

Attribute "name".

val novalidate : t

Attribute "novalidate".

val open_ : t

Attribute "open".

val optimum : t

Attribute "optimum".

val pattern : t

Attribute "pattern".

val ping : t

Attribute "ping".

val placeholder : t

Attribute "placeholder".

val poster : t

Attribute "poster".

val preload : t

Attribute "preload".

val radiogroup : t

Attribute "radiogroup".

val readonly : t

Attribute "readonly".

val referrerpolicy : t

Attribute "referrerpolicy".

val rel : t

Attribute "rel".

val required : t

Attribute "required".

val reversed : t

Attribute "reversed".

val rows : t

Attribute "rows".

val rowspan : t

Attribute "rowspan".

val sandbox : t

Attribute "sandbox".

val scope : t

Attribute "scope".

val scoped : t

Attribute "scoped".

val selected : t

Attribute "selected".

val shape : t

Attribute "shape".

val size : t

Attribute "size".

val sizes : t

Attribute "sizes".

val slot : t

Attribute "slot".

val span : t

Attribute "span".

val spellcheck : t

Attribute "spellcheck".

val src : t

Attribute "src".

val srcdoc : t

Attribute "srcdoc".

val srclang : t

Attribute "srclang".

val srcset : t

Attribute "srcset".

val start : t

Attribute "start".

val step : t

Attribute "step".

val style : t

Attribute "style".

val summary : t

Attribute "summary".

val tabindex : t

Attribute "tabindex".

val target : t

Attribute "target".

val title : t

Attribute "title".

val translate : t

Attribute "translate".

val text : t

Attribute "Text".

val type_ : t

Attribute "type".

val usemap : t

Attribute "usemap".

val value : t

Attribute "value".

val width : t

Attribute "width".

val wrap : t

Attribute "wrap".

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html b/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html deleted file mode 100644 index 4dbff5ae..00000000 --- a/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Out (tiny_httpd.Tiny_httpd_html_.Out)

Module Tiny_httpd_html_.Out

Output for HTML combinators.

This output type is used to produce a string reasonably efficiently from a tree of combinators.

type t
val create : unit -> t
val clear : t -> unit
val add_char : t -> char -> unit
val add_string : t -> string -> unit
val add_format_nl : t -> unit
val with_no_format_nl : t -> (unit -> 'a) -> 'a
val to_string : t -> string
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/Response/index.html b/dev/tiny_httpd/Tiny_httpd_server/Response/index.html index a032f347..94e1127f 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Response/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Response/index.html @@ -3,7 +3,7 @@ ?headers:Headers.t -> code:Response_code.t -> byte_stream -> - t

Same as make_raw but with a stream body. The body will be sent with the chunked transfer-encoding.

val make_void : ?headers:Headers.t -> code:int -> unit -> t

Return a response without a body at all.

  • since NEXT_RELEASE
val make : + t

Same as make_raw but with a stream body. The body will be sent with the chunked transfer-encoding.

val make_void : ?headers:Headers.t -> code:int -> unit -> t

Return a response without a body at all.

  • since 0.13
val make : ?headers:Headers.t -> (body, Response_code.t * string) Stdlib.result -> t

make r turns a result into a response.

  • make (Ok body) replies with 200 and the body.
  • make (Error (code,msg)) replies with the given error code and message as body.
val make_string : diff --git a/dev/tiny_httpd/Tiny_httpd_server/index.html b/dev/tiny_httpd/Tiny_httpd_server/index.html index d7680470..f17eaa14 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/index.html @@ -1,5 +1,5 @@ -Tiny_httpd_server (tiny_httpd.Tiny_httpd_server)

Module Tiny_httpd_server

HTTP server.

This module implements a very simple, basic HTTP/1.1 server using blocking IOs and threads.

It is possible to use a thread pool, see create's argument new_thread.

  • since NEXT_RELEASE
type buf = Tiny_httpd_buf.t
type byte_stream = Tiny_httpd_stream.t

HTTP Methods

module Meth : sig ... end

Headers

Headers are metadata associated with a request or response.

module Headers : sig ... end

Requests

Requests are sent by a client, e.g. a web browser or cURL. From the point of view of the server, they're inputs.

module Request : sig ... end

Response Codes

module Response_code : sig ... end

Responses

Responses are what a http server, such as Tiny_httpd, send back to the client to answer a Request.t

module Response : sig ... end

Routing

Basic type-safe routing of handlers based on URL paths. This is optional, it is possible to only define the root handler with something like Routes.

  • since 0.6
module Route : sig ... end

Middlewares

A middleware can be inserted in a handler to modify or observe its behavior.

  • since 0.11
module Middleware : sig ... end

Main Server type

type t

A HTTP server. See create for more details.

val create : +Tiny_httpd_server (tiny_httpd.Tiny_httpd_server)

Module Tiny_httpd_server

HTTP server.

This module implements a very simple, basic HTTP/1.1 server using blocking IOs and threads.

It is possible to use a thread pool, see create's argument new_thread.

  • since 0.13
type buf = Tiny_httpd_buf.t
type byte_stream = Tiny_httpd_stream.t

HTTP Methods

module Meth : sig ... end

Headers

Headers are metadata associated with a request or response.

module Headers : sig ... end

Requests

Requests are sent by a client, e.g. a web browser or cURL. From the point of view of the server, they're inputs.

module Request : sig ... end

Response Codes

module Response_code : sig ... end

Responses

Responses are what a http server, such as Tiny_httpd, send back to the client to answer a Request.t

module Response : sig ... end

Routing

Basic type-safe routing of handlers based on URL paths. This is optional, it is possible to only define the root handler with something like Routes.

  • since 0.6
module Route : sig ... end

Middlewares

A middleware can be inserted in a handler to modify or observe its behavior.

  • since 0.11
module Middleware : sig ... end

Main Server type

type t

A HTTP server. See create for more details.

val create : ?masksigpipe:bool -> ?max_connections:int -> ?timeout:float -> @@ -40,4 +40,4 @@ t -> ('a, string Request.t -> server_sent_generator -> unit) Route.t -> 'a -> - unit

Add a handler on an endpoint, that serves server-sent events.

The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.

This handler stays on the original thread (it is synchronous).

  • since 0.9

Run the server

val stop : t -> unit

Ask the server to stop. This might not have an immediate effect as run might currently be waiting on IO.

val run : ?after_init:(unit -> unit) -> t -> (unit, exn) Stdlib.result

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.

  • parameter after_init

    is called after the server starts listening. since NEXT_RELEASE .

\ No newline at end of file + unit

Add a handler on an endpoint, that serves server-sent events.

The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.

This handler stays on the original thread (it is synchronous).

  • since 0.9

Run the server

val stop : t -> unit

Ask the server to stop. This might not have an immediate effect as run might currently be waiting on IO.

val run : ?after_init:(unit -> unit) -> t -> (unit, exn) Stdlib.result

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.

  • parameter after_init

    is called after the server starts listening. since 0.13 .

\ No newline at end of file