Documentation
¶
Overview ¶
Package ptystream defines the framed duplex byte-stream protocol spoken over a hijacked takod exec connection. It is the machine contract for interactive exec: a control plane bridges these frames to a browser terminal over its own SSH connection.
After the HTTP/1.1 upgrade handshake (Upgrade: tako-pty/1) both sides exchange frames: 1 type byte, a 4-byte big-endian payload length, then the payload. The server's terminal frame is Exit; nothing follows it.
Index ¶
Constants ¶
const ( // FrameStdin carries raw input bytes for the remote process. FrameStdin byte = 1 // FrameStdout carries raw output bytes. A PTY merges stdout and stderr // into one stream by nature; non-PTY interactive exec merges them to // match, so there is no separate stderr frame. FrameStdout byte = 2 // FrameResize carries a terminal size change: cols and rows as // big-endian uint16s (4 payload bytes). FrameResize byte = 3 // FrameExit is the terminal frame: the remote command's exit code as a // big-endian int32 (4 payload bytes). -1 reports a run failure that // produced no exit code. FrameExit byte = 4 // FrameContainer names the resolved target container. The server sends // it once before any output. FrameContainer byte = 5 // FrameError carries a fatal server-side message emitted before Exit. FrameError byte = 6 )
Frame types. Stdin/Resize flow client to server; the rest flow server to client.
const MaxPayload = 1 << 20
MaxPayload bounds a single frame's payload. Larger frames are a protocol error: output is chunked by the PTY read loop and stdin by the terminal.
const Protocol = "tako-pty/1"
Protocol is the HTTP Upgrade token that selects this stream version. Version bumps get a new token; the server rejects unknown tokens.
Variables ¶
This section is empty.
Functions ¶
func DecodeExit ¶
DecodeExit parses an Exit frame payload.
func EncodeResize ¶
EncodeResize renders a Resize frame payload.
Types ¶
type Winsize ¶
Winsize is a terminal size in character cells.
func DecodeResize ¶
DecodeResize parses a Resize frame payload.