package tiny_httpd

  1. Overview
  2. Docs

Handler that upgrades to another protocol.

  • since 0.17
type handshake_state

Some specific state returned after handshake

val name : string

Name in the "upgrade" header

val handshake : Unix.sockaddr -> unit Request.t -> (Headers.t * handshake_state, string) result

Perform the handshake and upgrade the connection. This returns either Ok (resp_headers, state) in case of success, in which case the server sends a 101 response with resp_headers; or it returns Error log_msg if the the handshake fails, in which case the connection is closed without further ado and log_msg is logged locally (but not returned to the client).

val handle_connection : handshake_state -> IO.Input.t -> IO.Output.t -> unit

Take control of the connection and take it from ther.e

OCaml

Innovation. Community. Security.