Protocol Specifications
Terminal Transport (WebSocket v3)
VibeTunnel uses a single WebSocket endpoint for terminal transport, multiplexing sessions over binary frames.Connection Establishment
Subscriptions
- Subscribe per session: send a v3
SUBSCRIBEframe withsessionId+ flags (Stdout,Snapshots,Events). - Global events: use an empty
sessionIdand theEventsflag.
docs/websocket.md and web/src/shared/ws-v3.ts.
Error Codes
| Code | Meaning | Action |
|---|---|---|
| 1000 | Normal closure | Session ended |
| 1001 | Going away | Server shutdown |
| 1003 | Unsupported data | Protocol error |
| 1008 | Policy violation | Auth failed |
| 1011 | Server error | Retry connection |
PTY Protocol
Process Spawning
Control Sequences
| Sequence | Purpose | Example |
|---|---|---|
\x03 | SIGINT (Ctrl+C) | Interrupt process |
\x04 | EOF (Ctrl+D) | End input |
\x1a | SIGTSTP (Ctrl+Z) | Suspend process |
\x1c | SIGQUIT (Ctrl+) | Quit process |
\x7f | Backspace | Delete character |
Terminal Modes
Session Recording Protocol
Asciinema v2 Format
Header:o: Output from terminali: Input from userr: Terminal resize
Recording Storage
HTTP Protocol
Request Headers
Response Headers
Status Codes
| Code | Meaning | Usage |
|---|---|---|
| 200 | OK | Successful operation |
| 201 | Created | Session created |
| 204 | No Content | Session deleted |
| 400 | Bad Request | Invalid parameters |
| 401 | Unauthorized | Auth required |
| 404 | Not Found | Session not found |
| 409 | Conflict | Session exists |
| 429 | Too Many Requests | Rate limited |
| 500 | Server Error | Internal error |
Terminal Transport (WebSocket v3)
VibeTunnel uses a single WebSocket endpoint for terminal transport:- Endpoint:
GET /ws(upgrade) - Binary framing:
"VT"magic + version + type + sessionId + payload - Multiplexing: one socket can carry multiple sessions
- Subscriptions: flags for
stdout,snapshots,events
docs/websocket.md.