From 7d599a68eaf8eb22d047b5952be17aec4540200c Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 17 Sep 2018 09:07:46 +0900 Subject: [PATCH] pong --- src/server/api/streaming.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/api/streaming.ts b/src/server/api/streaming.ts index 873719d031..09ec23a743 100644 --- a/src/server/api/streaming.ts +++ b/src/server/api/streaming.ts @@ -45,6 +45,12 @@ module.exports = (server: http.Server) => { ev.removeAllListeners(); }); + connection.on('message', async (data) => { + if (data.utf8Data == 'ping') { + connection.send('pong'); + } + }); + const q = request.resourceURL.query as ParsedUrlQuery; const [user, app] = await authenticate(q.i as string);