Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-03-21 23:00:04 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-03-21 23:00:04 +0300
commitd72ea8b20ca9d5ca5c615e34a5b209844be9b3fe (patch)
tree9defba5a82580d1fcd1a3903a946c6fabc17fb31 /docs
parent7a86084046a2e4fcd761393e2b2274e428f4009e (diff)
docs: explain torrent.addPeer(peer) arguments
Fix #687
Diffstat (limited to 'docs')
-rw-r--r--docs/api.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/api.md b/docs/api.md
index 9ca5760..49f2b1e 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -199,16 +199,22 @@ Get the torrent download location.
Alias for `client.remove(torrent)`.
-## `torrent.addPeer(addr)`
+## `torrent.addPeer(peer)`
Adds a peer to the underlying [bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance.
Returns `true` if peer was added, `false` if peer was blocked by the loaded blocklist.
+The `peer` argument must be an address string in the format `12.34.56.78:4444` (for
+normal TCP/uTP peers), or a [`simple-peer`](https://github.com/feross/simple-peer)
+instance (for WebRTC peers).
+
## `torrent.addWebSeed(url)`
Adds a web seed to the [bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance.
+The `url` argument is the web seed URL.
+
## `torrent.select(start, end, [priority], [notify])`
Selects a range of pieces to prioritize starting with `start` and ending with `end` (both inclusive)