package shuttle_websocket
Module Shuttle_websocketSource
Source
val create :
?config:Config.t ->
(Websocket.t -> unit Async.Deferred.t) ->
Shuttle_http.Request.t ->
Shuttle_http.Response.t Async.Deferred.tcreate accepts a user provided websocket-handler and performs an HTTP/1.1 protocol upgrade. create returns a http response that either represents an error indicating a bad upgrade request, or contains a `Switching-Protocol` response with an HTTP protocol upgrade handler. If the protocol negotiation succeeds the user provided websocket handler will be called with a websocket descriptor. Once the deferred returned by the websocket-handler is resolved, or if there are any unhandled exceptions in the handler the underlying TCP connection is closed.