bittorrent-swarm
![downloads](https://img.shields.io/npm/dm/bittorrent-swarm.svg)
This package is deprecated. bitorrent-swarm
is now directly part of WebTorrent.
Simple, robust, BitTorrent "swarm" implementation
![Sauce Test Status](https://saucelabs.com/browser-matrix/bittorrent-swarm.svg)
This is a node.js abstraction of a BitTorrent "swarm", which is handy for
managing all peer connections for a given torrent download. This handles
connecting to peers, listening for incoming connections, and doing the initial
peer wire protocol handshake with peers. It also tracks total data
uploaded/downloaded to/from the swarm.
This module is used by WebTorrent.
install
npm install bittorrent-swarm
methods
var Swarm = require('bittorrent-swarm')
var swarm = new Swarm(myInfoHash, myPeerId)
swarm.on('wire', function(wire) {
wire.on('unchoke', function() {
})
swarm.wires
});
swarm.addPeer('127.0.0.1:42442')
swarm.removePeer('127.0.0.1:42244')
license
MIT
This was originally forked from peer-wire-swarm which is also MIT licensed.