package miaou-driver-web
Install
dune-project
Dependency
Authors
Maintainers
Sources
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.
Whether this driver is available. Always true when compiled.
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.
An extra static asset served by the web server.
For example, a logo image: {path = "/logo.png"; content_type = "image/png"; body = logo_data}
val 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:
/— servescontroller_html(default: built-in index.html)/viewer— servesviewer_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 inextra_assets, else 404