PtyConnection
Source: src/services/pty.ts
Signature
Section titled “Signature”PtyConnection(socket: WebSocket)Overview
Section titled “Overview”Thin wrapper around an interactive PTY websocket connection.
Throws
Section titled “Throws”Leap0WebSocketError: If the websocket errors or closes while receiving data.
Methods
Section titled “Methods”send(data: string | ArrayBufferLike | Blob | ArrayBufferView): voidSends raw data to the PTY websocket.
Parameters
Section titled “Parameters”data: Raw payload to send.
recv(): Promise<Uint8Array>Waits for the next websocket message.
Returns
Section titled “Returns”- The next websocket payload as bytes.
Throws
Section titled “Throws”Leap0WebSocketError: If the websocket errors or closes before a message arrives.
close(): voidCloses the websocket connection.