execute instead.
Open a shell
shell() returns a websocket-client connection. Send and receive the JSON messages below as text. In Go, use the SendShellInput, ResizeShell and RecvShellMessage helpers.
Messages
Every message is a JSON text frame.
Send only the two client message types above. The sandbox ignores raw text, binary frames and other types.
Session behavior
- The shell runs bash as
root, withHOME=/root. - Output is raw terminal output. It includes the echo of your input,
\r\nline endings and control characters, and stderr is merged into stdout. - One command’s output can arrive in several
stdoutmessages. Keep reading until you see the prompt, or set a read timeout. - Disconnecting and reconnecting returns you to the same session. The working directory and exported variables are kept.
- Only one connection can be attached at a time. A second connection receives
connected, then anerrormessage, and no output. The first connection is not affected.