Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate bittorrent-swarm, inline into webtorrent #704

Merged
merged 9 commits into from Mar 29, 2016

documentation fixes

  • Loading branch information
feross committed Mar 29, 2016
commit feb84a26504ece2b6cd8ffb63f2bcbe395c6da9b
@@ -288,7 +288,6 @@ These are the main modules that make up WebTorrent:
| [bittorrent-dht][bittorrent-dht] | [![][bittorrent-dht-ti]][bittorrent-dht-tu] | [![][bittorrent-dht-ni]][bittorrent-dht-nu] | distributed hash table client
| [bittorrent-peerid][bittorrent-peerid] | [![][bittorrent-peerid-ti]][bittorrent-peerid-tu] | [![][bittorrent-peerid-ni]][bittorrent-peerid-nu] | identify client name/version
| [bittorrent-protocol][bittorrent-protocol] | [![][bittorrent-protocol-ti]][bittorrent-protocol-tu] | [![][bittorrent-protocol-ni]][bittorrent-protocol-nu] | bittorrent protocol stream
| [bittorrent-swarm][bittorrent-swarm] | [![][bittorrent-swarm-ti]][bittorrent-swarm-tu] | [![][bittorrent-swarm-ni]][bittorrent-swarm-nu] | bittorrent connection manager
| [bittorrent-tracker][bittorrent-tracker] | [![][bittorrent-tracker-ti]][bittorrent-tracker-tu] | [![][bittorrent-tracker-ni]][bittorrent-tracker-nu] | bittorrent tracker server/client
| [create-torrent][create-torrent] | [![][create-torrent-ti]][create-torrent-tu] | [![][create-torrent-ni]][create-torrent-nu] | create .torrent files
| [magnet-uri][magnet-uri] | [![][magnet-uri-ti]][magnet-uri-tu] | [![][magnet-uri-ni]][magnet-uri-nu] | parse magnet uris
@@ -323,12 +322,6 @@ These are the main modules that make up WebTorrent:
[bittorrent-protocol-ni]: https://img.shields.io/npm/v/bittorrent-protocol.svg
[bittorrent-protocol-nu]: https://www.npmjs.com/package/bittorrent-protocol

[bittorrent-swarm]: https://github.com/feross/bittorrent-swarm
[bittorrent-swarm-ti]: https://img.shields.io/travis/feross/bittorrent-swarm/master.svg
[bittorrent-swarm-tu]: https://travis-ci.org/feross/bittorrent-swarm
[bittorrent-swarm-ni]: https://img.shields.io/npm/v/bittorrent-swarm.svg
[bittorrent-swarm-nu]: https://www.npmjs.com/package/bittorrent-swarm

[bittorrent-tracker]: https://github.com/feross/bittorrent-tracker
[bittorrent-tracker-ti]: https://img.shields.io/travis/feross/bittorrent-tracker/master.svg
[bittorrent-tracker-tu]: https://travis-ci.org/feross/bittorrent-tracker
@@ -201,10 +201,6 @@ Magnet URI of the torrent (string).
Array of all files in the torrent. See documentation for `File` below to learn what
methods/properties files have.

## `torrent.swarm`

The attached [bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance.

## `torrent.received`

Total bytes received from peers (*including* invalid data).
@@ -251,10 +247,9 @@ Alias for `client.remove(torrent)`.

## `torrent.addPeer(peer)`

Adds a peer to the underlying
[bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance. Normally, you
don't need to call `torrent.addPeer()`. WebTorrent will automatically find peers using the
tracker servers or DHT. This is just for manually adding a peer to the client.
Adds a peer to the torrent swarm. Normally, you don't need to call `torrent.addPeer()`.
WebTorrent will automatically find peers using the tracker servers or DHT. This is just
for manually adding a peer to the client.

Returns `true` if peer was added, `false` if peer was blocked by the loaded blocklist.

@@ -264,7 +259,11 @@ instance (for WebRTC peers).

## `torrent.addWebSeed(url)`

Adds a web seed to the [bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance.
Adds a web seed to the torrent swarm. For more information on BitTorrent web seeds, see
[BEP19](http://www.bittorrent.org/beps/bep_0019.html).

In the browser, web seed servers must have proper CORS (Cross-origin resource sharing)
headers so that data can be fetched across domain.

The `url` argument is the web seed URL.

@@ -1,7 +1,7 @@
module.exports = WebConn

var BitField = require('bitfield')
var debug = require('debug')('bittorrent-swarm:webconn')
var debug = require('debug')('webtorrent:webconn')
var get = require('simple-get')
var inherits = require('inherits')
var sha1 = require('simple-sha1')
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.