
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
exp-amqp-connection
Advanced tools
This library is intended for doing simple publish and subscribe to an amqp broker.
Limitations:
Exposes a single function that boostraps a broker object, which in turn can be used for publishing and consuming messages. The connection will be re-established in case of errors.
For example:
const init = require("exp-amqp-connection");
const behaviour = {
exchange: "my-exchange",
url: "amqp://localhost"
};
const broker = init(behaviour);
broker.subscribeTmp("routingKey1", console.log);
broker.subscribeTmp("routingKey2", console.log);
broker.publish("routingKey1", "Msg 1");
broker.publish("routingKey1", "Msg 2");
// Delay delivery with 3000 ms using temporary exchange/queue-pair and dead-lettering.
broker.delayedPublish("routingKey2", "Msg 3", 3000);
The following options are accepted:
The broker object returned has the following functions. See the examples for more info on parameters etc.
Regular publish
Delayed publish using dead-letter-hack: https://www.cloudamqp.com/docs/delayed-messages.html
Subscribe using named durable queue.
If you need to wait for the subscription to start, use .on("subscribed", (sub) => ...)
Subscribe using nameless tmp queue. Queue will be destroyed when the broker disconnects.
If you need to wait for the subscription to start, use .on("subscribed", (sub) => ...)
Shuts down connection to broker.
By default one and only one connection is maintained for the entire process.
It is possible to add more by initializing with another configKey
.
For example:
const init = require("exp-amqp-connection");
const behaviour = {
exchange: "my-exchange",
url: "amqp://localhost",
configKey: "my-amqp"
};
// 1st connection
const broker = init(behaviour);
const otherBehaviour = {
url: "amqp://otherhost",
exchange: "other-exchange",
configKey: "other-amqp"
}
const broker2 = init(behaviour2)
FAQs
Wrapper for amqp lib that adds some nice features
We found that exp-amqp-connection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 18 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.