package shuttle_http

  1. Overview
  2. Docs
Async library for HTTP/1.1 servers and clients

Install

dune-project
 Dependency

Authors

Maintainers

Sources

shuttle-0.9.0.tbz
sha256=fd61626c46dcbd63449746b55e1b0821119e5215c6b32330f9671fbb306812ef
sha512=f06946e9271acd8df613385f7b94facb3d807b031c7eb21fac30886db0f45d8615b6eb71132455008b746513de3590d77890518e0c1a2672f1434cd9c1d97f67

doc/shuttle_http/Shuttle_http/Server/Config/index.html

Module Server.ConfigSource

Sourcetype t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval default : t
Sourceval create : ?buf_len:int -> ?max_connections:int -> ?max_accepts_per_batch:int -> ?backlog:int -> ?write_timeout:Core.Time_ns.Span.t -> ?read_header_timeout:Core.Time_ns.Span.t -> ?error_handler:error_handler -> unit -> t

HTTP Server configuration

  • buf_len is the buffer size used for the underlying tcp socket channel. The default value is 16_000 bytes.
  • max_connections is the maximum number of concurrent connections that can be active within a server. The default behavior is to have no upper bound on this number.
  • max_accepts_per_batch is the maximum number of socket connections that a server will attempt to accept in a single accept call. The default value is 1.
  • backlog is the number of clients that can have a pending connection. Additional connections can be rejected, enqueued or ignored based on the underlying operating system's behavior.
  • write_timeout is the maximum duration that the underlying socket will wait for any pending write syscalls to finish.
  • read_header_timeout is the maximum time span that the server loop is allowed to read a request's headers. The default value is 60 seconds. If read_header_timeout is zero then no timeout is used, and the server could potentially wait forever attempting to read enough data to parse request headers.
  • error_handler allows customizing how unhandled exceptions, and any potential parsing or i/o errors get rendered. The default implementation will attempt to send an HTTP response with a status code and an empty body.