package miaou-driver-web

  1. Overview
  2. Docs
Miaou web driver (xterm.js over WebSocket)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.5.2.tar.gz
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6

doc/miaou-driver-web.driver/Miaou_driver_web/Web_websocket/index.html

Module Miaou_driver_web.Web_websocketSource

Minimal WebSocket implementation for Eio.

Implements RFC 6455 WebSocket protocol using direct flow writes (no Buf_write buffering).

Sourcetype t

A WebSocket connection.

Sourceval parse_headers : Eio.Buf_read.t -> (string, string) Hashtbl.t

Parse HTTP headers from a buffered reader until a blank line. Returns a hashtable of lowercase header names to values.

Sourceval upgrade : (string, string) Hashtbl.t -> write:(string -> unit) -> t option

Attempt a WebSocket upgrade given parsed HTTP headers. Sends the 101 Switching Protocols response via the write function. Returns None if the headers are not a valid upgrade request.

Sourceval send_text : t -> string -> unit

Send a text frame.

Sourceval recv_text : t -> Eio.Buf_read.t -> string option

Receive the next text message. Handles ping/pong automatically. Returns None on connection close.

Sourceval close : t -> unit

Send a close frame and shut down.

Sourceval is_closed : t -> bool

Check whether the connection has been closed.