package websocket-lwt-unix

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val upgrade_connection : Cohttp.Request.t -> (Websocket.Frame.t -> unit) -> (Cohttp_lwt_unix.Server.response_action * (Websocket.Frame.t option -> unit)) Lwt.t

upgrade_connection req incoming_handler takes req, a connection request, and incoming_handler, a function that will process incoming websocket frames, and returns (response_action, push_frame) where response_action is used to produce a Cohttp_lwt.Server.t and push_frame is used to send websocket frames to the client.