Socket
Socket
Sign inDemoInstall

bittorrent-swarm

Package Overview
Dependencies
26
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bittorrent-swarm

Simple, robust, BitTorrent swarm implementation


Version published
Weekly downloads
71
increased by173.08%
Maintainers
1
Install size
729 kB
Created
Weekly downloads
 

Readme

Source

bittorrent-swarm travis npm downloads

This package is deprecated. bitorrent-swarm is now directly part of WebTorrent.

Simple, robust, BitTorrent "swarm" implementation

Sauce Test Status

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) {
	// a relevant wire has appeared, see `bittorrent-protocol` for more info

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

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

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

license

MIT

This was originally forked from peer-wire-swarm which is also MIT licensed.

Keywords

FAQs

Last updated on 29 Mar 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc