Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
discovery-swarm
Advanced tools
A network swarm that uses discovery-channel to find and connect to peers.
This module implements peer connection state and builds on discovery-channel which implements peer discovery. This uses TCP sockets by default and has experimental support for UTP.
npm install discovery-swarm
var swarm = require('discovery-swarm')
var sw = swarm()
sw.listen(1000)
sw.add('ubuntu-14.04') // can be any id/name/hash
sw.on('connection', function (connection) {
console.log('found + connected to peer')
})
var sw = swarm()
Create a new swarm
sw.add(key)
Add key
(usually a name, hash or id, must be a Buffer) to the list of keys to use to discover and connect to peers. After adding will immediately search for peers advertising this key, and re-announce on a timer.
sw.remove(key)
Remove key
from the list of keys
sw.peersQueued
Number of peers discovered but not connected to yet
sw.peersConnecting
Number of peers we are trying to connect to
sw.peersConnected
Number of peers we are actively connected to. Same as sw.connections.length
.
sw.connections
List of active connections to other peers
sw.on('connection', connection)
Emitted when you connect to another peer
sw.listen(port)
Listen on a specific port. Should be called before add
MIT
FAQs
A network swarm that uses discovery-channel to find peers
The npm package discovery-swarm receives a total of 53 weekly downloads. As such, discovery-swarm popularity was classified as not popular.
We found that discovery-swarm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.