Socket
Socket
Sign inDemoInstall

@geckos.io/client

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geckos.io/client - npm Package Compare versions

Comparing version 1.3.0-alpha.0 to 1.3.0

18

lib/client.js

@@ -49,3 +49,3 @@ "use strict";

function ClientChannel(url, port, label, rtcConfiguration) {
// TODO (yandeu): remove old messages from this.receivedReliableMessages
// stores all reliable messages for about 15 seconds
this.receivedReliableMessages = [];

@@ -157,5 +157,19 @@ this.url = url + ":" + port;

var isReliableMessage = data && typeof data.MESSAGE !== 'undefined' && data.RELIABLE === 1 && data.ID !== 'undefined';
var expireTime = 15000; // 15 seconds
var deleteExpiredReliableMessages = function () {
var currentTime = new Date().getTime();
_this.receivedReliableMessages.forEach(function (msg, index, object) {
if (msg.expire <= currentTime) {
object.splice(index, 1);
}
});
};
if (isReliableMessage) {
deleteExpiredReliableMessages();
if (_this.receivedReliableMessages.filter(function (obj) { return obj.id === data.ID; }).length === 0) {
_this.receivedReliableMessages.push({ date: new Date(), id: data.ID });
_this.receivedReliableMessages.push({
id: data.ID,
timestamp: new Date(),
expire: new Date().getTime() + expireTime
});
callback(data.MESSAGE);

@@ -162,0 +176,0 @@ }

6

package.json
{
"name": "@geckos.io/client",
"version": "1.3.0-alpha.0",
"version": "1.3.0",
"description": "Real-time client/server communication over UDP using WebRTC and Node.js",

@@ -37,3 +37,3 @@ "main": "lib/index.js",

"engines": {
"node": "^8 || ^10 || ^11 || ^12"
"node": "^8 || ^10 || ^11 || ^12 || ^13"
},

@@ -48,4 +48,4 @@ "scripts": {

"dependencies": {
"@geckos.io/common": "^1.3.0-alpha.0"
"@geckos.io/common": "^1.3.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc