pws

peer-wire-swarm

swarm implementation for bittorrent

Showing:

Popularity

Downloads/wk

486

GitHub Stars

76

Maintenance

Last Commit

4yrs ago

Contributors

7

Package

Dependencies

6

Size (min+gzip)

13.0KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

peer-wire-swarm

Swarm implementation for Bittorrent

npm install peer-wire-swarm

Usage

var wireSwarm = require('peer-wire-swarm');
var swarm = wireSwarm(myInfoHash, myPeerId);

swarm.on('wire', function(wire) {
    // a relevant peer-wire-protocol as appeared
    // see the peer-wire-protocol module for more info

    wire.on('unchoke', function() {
        // we are now unchoked
    });

    swarm.wires // <- list of all connected wires
});

swarm.add('127.0.0.1:42442'); // add a peer
swarm.remove('127.0.0.1:42244'); // remove a peer

swarm.pause();  // pause the swarm (stops adding connections)
swarm.resume(); // resume the swarms

swarm.listen(6881); // listen for incoming connections (optional)

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100