feat: implement naive client ping

This commit is contained in:
Carlos Valente
2024-11-17 13:57:34 +01:00
committed by Carlos Valente
parent d87542dcf7
commit 8dd448db44
8 changed files with 74 additions and 7 deletions
@@ -100,6 +100,16 @@ export class SocketServer implements IAdapter {
const message = JSON.parse(data);
const { type, payload } = message;
if (type === 'ping') {
ws.send(
JSON.stringify({
type: 'pong',
payload,
}),
);
return;
}
if (type === 'get-client-name') {
ws.send(
JSON.stringify({