Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hubbie

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubbie - npm Package Compare versions

Comparing version 3.2.4 to 4.0.0

2

package.json
{
"name": "hubbie",
"version": "3.2.4",
"version": "4.0.0",
"description": "WebSocket manager",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -45,6 +45,6 @@ # Hubbie

localServer.send(eventObj.peerName, 'Welcome!');
return true;
return Promise.resolve(true);
} else {
console.log('Client rejected');
return false;
return Promise.resolve(false);
}

@@ -51,0 +51,0 @@ });

@@ -13,5 +13,7 @@ 'use strict'

};
if (msgHandler.onPeer(eventObj)) {
return eventObj.peerName;
}
return msgHandler.onPeer(eventObj).then((verdict) => {
if (verdict) {
return eventObj.peerName;
}
});
}

@@ -31,14 +33,15 @@

// because this way we have peerName available here for the addChannel call:
const peerName = checkCreds(httpReq.url, msgHandler);
if (peerName !== undefined) {
msgHandler.addChannel(peerName, ws);
ws.on('message', (msg) => {
msgHandler.onMessage(peerName, msg);
});
ws.on('close', () => {
msgHandler.removeChannel(peerName);
});
} else {
ws.close();
}
checkCreds(httpReq.url, msgHandler).then((peerName) => {
if (peerName !== undefined) {
msgHandler.addChannel(peerName, ws);
ws.on('message', (msg) => {
msgHandler.onMessage(peerName, msg);
});
ws.on('close', () => {
msgHandler.removeChannel(peerName);
});
} else {
ws.close();
}
});
});

@@ -45,0 +48,0 @@ return wss;

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