Skip to content

Commit 6cab83f

Browse files
committed
send back pong
1 parent 89cca35 commit 6cab83f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/commands/shell.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ export default class Shell extends Command {
101101
ws.send(chunk)
102102
}
103103
})
104+
} else if (message.type === 'ping') {
105+
// Respond to server heartbeat
106+
if (ws.readyState === WS.OPEN) {
107+
ws.send(JSON.stringify({ type: 'pong' }))
108+
}
104109
}
105110
} catch {
106111
// Not JSON, treat as text output

0 commit comments

Comments
 (0)