
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
dual-broadcast
Advanced tools
Fan-out dual-protocol messages.
dual-protocol domains may be extended with the dual-broadcast module:
var dual = require('dual-protocol').use(require('dual-broadcast'));
Domains with this extension can create broadcast objects:
var domain = dual();
var broadcaster = domain.broadcast(['b']);
Here we've provided a specific mount point for the broadcaster at
['b']. newListener and removeListener events will be emitted
below that endpoint. By default, the broadcaster is mounted at
['broadcast'].
To register a mount point ['client', xxxxx] as potential recipient
of broadcasts:
broadcaster.register(['client', xxxxx]);
A map of subscriptions is created for each client. The subscriptions
will be removed when the ['disconnect', 'client', xxxx] event is
emitted on the domain.
To subscribe the registered ['client', xxxxx] to the broadcast point ['bbc', 'eight']:
broadcaster.subscribe(['client', xxxxx], ['bbc', 'eight']);
The registered client ['client', xxxxx] would now receive broadcasts from ['bbc', 'eight'].
Broadcast a message to every subscribed recipient by
broadcaster.send(['bbc', 'eight'], 'hello', { optional: 'metadata' });
All subscribers would receive a message from ['bbc', 'eight'] with body 'hello', and the given dualapi options.
Broadcast clients may be unsubscribed from specific subscriptions:
broadcaster.unsubscribe(['client', xxxxx], ['bbc', 'eight']);
A client is unsubscribed from all subscriptions, and removed as a potential subscription host, when the domain emits a disconnect event:
domain.send(['disconnect', 'client', xxxxx]);
Clients may be automatically registered on ['connect', '**'] events
by using the autoregister function.
broadcaster.autoregister(['client', '*']);
domain.send(['connect', 'client', 'zzz']);
At this point, ['client', 'zzz'] would be registered, as would any other client matching ['client', '*'] when they
connect.
When a subscriber is added to a broadcast channel, the domain emits a newListener event
domain.mount(['b', 'newListener'], function (body, ctxt) {
console.log(body.join('/'), ' is now a subscriber to ', ctxt.from.join('/'));
});
New subscribers on specific broadcast channels are are emitted below the newListener endpoint:
domain.mount(['b', 'newListener', 'bbc', 'eight'], function (body, ctxt) {
console.log(body.join('/'), ' is now a subscriber to ', ctxt.from.join('/'));
});
When a subscriber is removed from a broadcast channel, either by unsubscribe or disconnecting, the domain emits a removeListener event
domain.mount(['b', 'removeListener'], function (body, ctxt) {
console.log(body.join('/'), ' is no longer a subscriber to ', ctxt.from.join('/'));
});
Subscribers leaving a specific broadcast channel are emitted below the removeListener endpoint:
domain.mount(['b', 'removeListener', 'bbc', 'eight'], function (body, ctxt) {
console.log(body.join('/'), ' is no longer a subscriber to ', ctxt.from.join('/'));
});
FAQs
Broadcast host for dualapi
The npm package dual-broadcast receives a total of 5 weekly downloads. As such, dual-broadcast popularity was classified as not popular.
We found that dual-broadcast demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.