Skip to main content

handle_session

Function handle_session 

Source
pub async fn handle_session(
    socket: &mut WebSocket,
    session: &Arc<Session>,
    readonly: bool,
)
Expand description

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

Performs the full handshake (session ID → window size → scrollback replay → replay-end marker), then bridges WebSocket I/O with the terminal until the client disconnects or the shell exits. Calls Session::attach / Session::detach automatically.

This is the main building block for embedding tty-web in other applications that manage session creation themselves.