Hcs.Server.H1_handler

hcs · API reference

module C = Http1.Server_connection
type cached_prebuilt = {
  date : string;
  response : C.prebuilt;
}
val prebuilt_cache_key : 
  (Response.Prebuilt.t, cached_prebuilt) Hashtbl.t Domain.DLS.key
val h1_prebuilt_response : Response.Prebuilt.t -> C.prebuilt
val make_request : C.reqd -> body_reader:body_reader -> request
val to_response : Response.t -> C.response
val error_response : Status.t -> string -> C.response
val connection_has_upgrade : string -> bool
val wants_ws_upgrade : Http_core.Headers.t -> bool
val max_body_int : int64 option -> int
val ws_upgrade_response : 
  ws_config:ws_config ->
  ws_key:string option ref ->
  Http_core.Headers.t ->
  C.response
val make_conn : 
  clock:[> float Eio.Time.clock_ty ] Eio.Time.clock ->
  request_timeout:float ->
  max_header_size:int ->
  handler:(request -> Response.t) ->
  ws_handler:'a option ->
  ws_config:ws_config ->
  ws_key:string option ref ->
  ?max_body_size:int64 ->
  ?body_buffer_limit:int ->
  unit ->
  C.t
val drive : 
  clock:[> float Eio.Time.clock_ty ] Eio.Time.clock ->
  timeouts:timeouts ->
  conn:C.t ->
  cbuf:Conn_buffers.t ->
  [> `Flow | `R | `W ] Eio.Flow.sink ->
  initial:string ->
  unit
val run_ws : 
  ws_handler:(Websocket.t -> unit) option ->
  ws_config:ws_config ->
  ws_key:'a option ref ->
  conn:C.t ->
  [> Eio.Flow.two_way_ty ] Eio.Resource.t ->
  unit
val handle : 
  sw:'a ->
  clock:[> float Eio.Time.clock_ty ] Eio.Time.clock ->
  timeouts:timeouts ->
  max_header_size:int ->
  handler:(request -> Response.t) ->
  ws_handler:(Websocket.t -> unit) option ->
  ?ws_config:ws_config ->
  ?max_body_size:int64 ->
  ?body_buffer_limit:int ->
  initial_data:string ->
  [> Eio.Flow.two_way_ty ] Eio.Flow.sink ->
  unit
val handle_direct : 
  sw:'a ->
  clock:[> float Eio.Time.clock_ty ] Eio.Time.clock ->
  timeouts:timeouts ->
  max_header_size:int ->
  ?max_body_size:int64 ->
  ?body_buffer_limit:int ->
  handler:(request -> Response.t) ->
  [> `Flow | `R | `W ] Eio.Flow.sink ->
  unit