Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@optio-labs/comms-bridge
Advanced tools
The library implements a "communications bridge" between endpoints in a multi-node messaging network.
The library implements a "communications bridge" between endpoints in a multi-node messaging network.
For instance, it can be used for messaging between the multiple processes required in a Chrome extension.
Install the library:
npm install --save @optio-labs/comms-bridge
Import the library:
import { CommsBridge } from "@optio-labs/comms-bridge";
Create an instance of the comms bridge:
const commsBridge = new CommsBridge("<identifier-for-this-endpoint>");
Add handlers to respond to incoming messages:
commsBridge.respond("<your-message-name>", payload => {
//
// Do something...
//
console.log("Message received!");
console.log(payload);
// Data that is returned from the handler
// is the reply payload received at other end of the message.
return {
// ... your data goes here ...
};
});
Send a message to another endpoint:
await commsBridge.send({
targetId: "<identifier-for-other-endpoint>",
name: "<your-message-name>",
payload: {
// ... your data goes here ...
},
});
Send a message and await a reply:
const replyPayload = await commsBridge.send(
{
targetId: "<identifier-for-other-endpoint>",
name: "<your-message-name>",
payload: {
// ... your data goes here ...
},
},
{
awaitReply: true,
}
);
console.log("Other endpoint replied with:");
console.log(replyPayload);
Add incoming and outgoing network transports:
commsBridge.addIncoming("", new IncomingMessageTransport());
commsBridge.addOutgoing("", new OutgoingMessageTransport());
IncomingMessageTransport
and OutgoingMessageTransport
are classes that should be implemented by you.
IncomingMessageTransport
feeds incoming messages from some messaging system or network protocol into the communications bridge.
OutgoingMessageTransport
sends outgoing messages from the communications bridge into some messaging system or network protocol.
Clone the repo and install dependencies:
npm install
Build the library:
npm run build
FAQs
The library implements a "communications bridge" between endpoints in a multi-node messaging network.
We found that @optio-labs/comms-bridge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.