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.
| Direction | Cmd | Payload | Description |
|---|---|---|---|
| client → server | 0x00 | raw bytes | Terminal input |
| client → server | 0x01 | rows(u16 BE) + cols(u16 BE) | Resize |
| server → client | 0x00 | raw bytes | Terminal output |
| server → client | 0x10 | UUID string | Session ID |
| server → client | 0x12 | — | Shell exited |
| server → client | 0x13 | rows(u16 BE) + cols(u16 BE) | Window size |
| server → client | 0x14 | — | Replay end |
Functions§
- handle_
session - Drive the tty-web binary protocol on an already-resolved session.
- ws_
handler