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_driver/index.html

Module Miaou_driver_web.Web_driverSource

Web backend for the Matrix driver.

Starts an HTTP server that serves an xterm.js-based web terminal. When a browser connects via WebSocket, the shared Matrix main loop runs and sends ANSI diff frames to the browser for rendering.

Uses the same rendering pipeline as the terminal Matrix driver: buffer, diff, ANSI writer. Only the I/O transport differs.

Sourceval available : bool

Whether this driver is available. Always true when compiled.

Sourcetype auth = {
  1. controller_password : string option;
  2. viewer_password : string option;
}

Authentication configuration for WebSocket connections.

Each password is optional. When None, no authentication is required for that role. When Some pw, the client must supply ?password=pw as a query parameter on the WebSocket URL.

Sourcetype extra_asset = {
  1. path : string;
  2. content_type : string;
  3. body : string;
}

An extra static asset served by the web server.

For example, a logo image: {path = "/logo.png"; content_type = "image/png"; body = logo_data}

Sourceval run : ?config:Miaou_driver_matrix.Matrix_config.t option -> ?port:int -> ?auth:auth -> ?controller_html:string -> ?viewer_html:string -> ?extra_assets:extra_asset list -> (module Miaou_core.Tui_page.PAGE_SIG) -> [ `Quit | `Back | `SwitchTo of string ]

Run the web driver.

Starts an HTTP server on port (default 8080) and waits for a browser to connect. The TUI runs over the WebSocket connection.

URL routing:

  • / — serves controller_html (default: built-in index.html)
  • /viewer — serves viewer_html (default: built-in viewer.html)
  • /client.js — serves the composable JS client
  • /ws — controller WebSocket (409 if slot taken)
  • /ws/viewer — viewer WebSocket (409 if no controller)
  • /* — looked up in extra_assets, else 404
  • parameter config

    Optional Matrix configuration override.

  • parameter port

    TCP port to listen on (default 8080).

  • parameter auth

    Optional authentication config (default: no auth).

  • parameter controller_html

    Custom HTML for the controller page.

  • parameter viewer_html

    Custom HTML for the viewer page.

  • parameter extra_assets

    Additional static assets to serve.