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.
It is a simplification of MQTT in NodeJS. All functions return a native-promise that you can use Asynchronously.
$ npm install --save mqtt-agent
const mqttAgent = require('mqtt-agent');
// const agent = new MQTTAgent('mqtt://yourmqttserver:8883'); // Default message callback
const agent = new MQTTAgent('mqtt://your-mqtt-server:8883', (topic, msg) => {
// Do something with your Topic and Message.
}); // Custom message callback
agent.connect() // Return a promise when it is connected to your server
.then((connected) => {
console.log('Connected:', connected); // Do something with the connected status
// You can now subscribe, publish and all with native promises!
return agent.subscribe('your_topic/your_device/something'); // Returns a promise
})
.then((subscribedTopic) => {
console.log('Topic subscribed to:', subscribedTopic);
// You can send options as last parameter
return agent.publish('yourTopic', 'yourMessage can be a JS Object or string');
})
.then((published) => {
console.log('Published (boolean):', published); // Then if you are subscribed to the topic, you will receive the message in your message callback
return agent.end(); // Disconnect
})
.then((disconnected) => {
console.log('Disconnected:', disconnected);
})
.catch((error) => {
console.log('Error:', error);
});
FAQs
This is a MQTT Agent
We found that mqtt-agent 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.