package websocket

  1. Overview
  2. Docs
val websocket_uuid : string
val b64_encoded_sha1sum : string -> string
val upgrade_present : Cohttp.Header.t -> bool
exception Protocol_error of string
module Rng : sig ... end
module Frame : sig ... end
val check_origin : ?origin_mandatory:bool -> hosts:string list -> Cohttp.Request.t -> bool

check_origin ~hosts req will return true if the origin header exists and matches one of the provided hostnames. If origin header is not present, return not origin_mandatory. Default value of origin_mandatory is false. If origin header is present but does not contain a hostname, return false. Hostnames in hosts are (ascii-)lowercased when compared.

val check_origin_with_host : Cohttp.Request.t -> bool

check_origin_with_host returns false if the origin header exists and its host doesn't match the host header

module type S = sig ... end
module Make (IO : Cohttp.S.IO) : S with type 'a IO.t = 'a IO.t and type IO.ic = IO.ic and type IO.oc = IO.oc

Innovation. Community. Security.