# Module `Ocsigen.Ocsigen_cohttp`

```ocaml
val section : Logs.src
```
```ocaml
exception Ocsigen_http_error of Ocsigen_cookie_map.t * Cohttp.Code.status
```
```ocaml
exception Ext_http_error of Cohttp.Code.status * string option * Cohttp.Header.t option
```
Exception raised by exceptions to describe an HTTP error. It is possible to pass the code of the error, an optional comment, and optionally some headers.

```ocaml
exception Ocsigen_is_dir of Request.t -> Uri.t
```
compute a redirection if path links to a directory

```ocaml
val get_number_of_connected : unit -> int
```
accessor to get number of client (used by eliom monitoring)

```ocaml
val shutdown : float option -> unit
```
Shutdown main loop of server

```ocaml
val service : 
  ?ssl:(string * string * (bool -> string) option) ->
  address:Config.socket_type ->
  port:int ->
  connector:(Request.t -> Response.t Lwt.t) ->
  unit ->
  unit Lwt.t
```
initialize a main loop of http server
