server for my chess game
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index 135e145..712343c 100644
--- a/src/index.js
+++ b/src/index.js
@@ -10,6 +10,7 @@ const HEADERS = {
joinrequest: "J",
hostrequest: "H",
stopgame: "K",
+ ping: "P",
};
let games = {};
@@ -79,6 +80,8 @@ wss.on("connection", (ws) => {
});
delete games[data];
break;
+ case HEADERS.ping:
+ send_packet("", HEADERS.ping, ws);
default:
console.log(`header ${header} unknown`);
break;