diff --git a/package-lock.json b/package-lock.json index ae8bb6f..17e899e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "webject", - "version": "1.4.41", + "version": "1.4.45", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "webject", - "version": "1.4.41", + "version": "1.4.45", "license": "Apache-2.0", "dependencies": { "ws": "^8.17.1" diff --git a/package.json b/package.json index 93c49c9..ffd9ea6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webject", - "version": "1.4.41", + "version": "1.4.45", "description": "Share Objects Online with the power of websockets. Keys, Values AND references. Webject is short for Web Object and it really is a system for sharing objects on the web. Someone can host an object, and make authTokens for others online to share this object", "main": "webject.js", "scripts": { diff --git a/webject.js b/webject.js index c77d682..19f77f9 100644 --- a/webject.js +++ b/webject.js @@ -226,9 +226,7 @@ if(encodingStorage.has(key)) return client.close(1002); //reused authentication rejected encodingStorage.set(key,performance.now()) //there is an interval a good bit above that dumps these keys after they're a second old (after they're already invalid) - client.on('pong',function(){client.isAlive=true}) encodingHandled=true - client.isAlive=true msg=msg[0] } else if(!authTokens.get(msg)) return client.close(1000); //if you client doesn't have a valid token, they get closed @@ -239,6 +237,8 @@ if(!token.encoder) client.send(objToString(token.object,true)); else client.send( await token.encoder(objToString(token.object,true)) ); + client.on('pong',function(){client.isAlive=true}) + client.isAlive=true client.token=token token.clients.set(client,1) dispatch("connect",token,client)