Skip to main content

Module ws

Module ws 

Source
Expand description

WebSocket handler implementing the tty-web binary protocol.

§Wire protocol

All WebSocket messages are binary frames. The first byte is the command, the rest is the payload.

DirectionCmdPayloadDescription
client → server0x00raw bytesTerminal input
client → server0x01rows(u16 BE) + cols(u16 BE)Resize
server → client0x00raw bytesTerminal output
server → client0x10UUID stringSession ID
server → client0x12Shell exited
server → client0x13rows(u16 BE) + cols(u16 BE)Window size
server → client0x14Replay end

Functions§

handle_session
Drive the tty-web binary protocol on an already-resolved session.
ws_handler