package websocketml

  1. Overview
  2. Docs
exception HTTPError of string
val print_address : Stdlib.out_channel -> Unix.sockaddr -> unit
module FieldMap : sig ... end
val print_fields : (Stdlib.out_channel -> 'a -> unit) -> Stdlib.out_channel -> 'a FieldMap.t -> unit
val ws_uuid : string
val build_server_key : string -> string
val accepted_fields : string array
val add_field : 'a FieldMap.t -> FieldMap.key -> 'a -> 'a FieldMap.t
type method_ty =
  1. | OPTIONS
  2. | GET
  3. | HEAD
  4. | POST
  5. | PUT
  6. | DELETE
  7. | TRACE
  8. | CONNECT
val method_ty_of_string : string -> method_ty
val string_of_method_ty : method_ty -> string
val print_method_ty : Stdlib.out_channel -> method_ty -> unit
type request = {
  1. typ : method_ty;
  2. uri : string;
  3. fields : string list FieldMap.t;
  4. content : string option;
}
val typ : request -> method_ty
val uri : request -> string
val fields : request -> string list FieldMap.t
val content : request -> string option
val print_request : Stdlib.out_channel -> request -> unit
type t = {
  1. addr : Unix.sockaddr;
  2. sock : Unix.file_descr;
}
val addr : t -> Unix.sockaddr
val sock : t -> Unix.file_descr
val to_string : t -> string
val print_t : Stdlib.out_channel -> t -> unit
val parse_request : string -> request
val create : Unix.sockaddr -> t
val close : t -> unit
val listen : t -> unit
val accept : t -> Unix.file_descr * Unix.sockaddr
val listen_and_accept : t -> Unix.file_descr * Unix.sockaddr
val send_response : Unix.file_descr -> string -> (string * string) list -> int
val check_ws_opening_request : request -> unit
val do_ws_handshake : Unix.file_descr -> unit