Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mafintosh/peer-wire-swarm
swarm implementation for bittorrent
https://github.com/mafintosh/peer-wire-swarm
Last synced: 8 days ago
JSON representation
swarm implementation for bittorrent
- Host: GitHub
- URL: https://github.com/mafintosh/peer-wire-swarm
- Owner: mafintosh
- License: mit
- Created: 2013-03-14T15:55:59.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-09-28T05:53:39.000Z (about 5 years ago)
- Last Synced: 2024-10-23T11:43:12.550Z (16 days ago)
- Language: JavaScript
- Homepage:
- Size: 43 KB
- Stars: 80
- Watchers: 5
- Forks: 18
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-peer-to-peer - peer-wire-swarm
- awesome-peer-to-peer - peer-wire-swarm
README
# peer-wire-swarm
Swarm implementation for Bittorrent
npm install peer-wire-swarm
# Usage
``` js
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 infowire.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 peerswarm.pause(); // pause the swarm (stops adding connections)
swarm.resume(); // resume the swarmsswarm.listen(6881); // listen for incoming connections (optional)
```## License
MIT