X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=sockets.js;h=62d51b70f72386040d63019eb83d82fa0f02ab17;hb=e5caeff0b650d8d9639bffd98ef8a5acc4fb85ac;hp=2a43e323d6cdf58616918d1323486862af8f823d;hpb=1d184b4c016a645228251ce984d4c980e60420b0;p=vchess.git diff --git a/sockets.js b/sockets.js index 2a43e323..62d51b70 100644 --- a/sockets.js +++ b/sockets.js @@ -18,6 +18,10 @@ module.exports = function(wss) { for (const v of Variants) clients[v.name] = {}; + // TODO: when relaying to opponent, check readyState, potential setTimeout()? + send opponent (re)disconnect + // (resign, newgame, newmove). See https://github.com/websockets/ws/blob/master/lib/websocket.js around line 313 + // TODO: awaiting newmove, resign, newgame :: in memory structure (use Redis ?) + wss.on("connection", (socket, req) => { //const params = new URL("http://localhost" + req.url).searchParams; var query = getJsonFromUrl(req.url);