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:
authorAlex <alxmorais8@msn.com>2020-07-05 01:27:17 +0300
committerGitHub <noreply@github.com>2020-07-05 01:27:17 +0300
commitf5231899ee018a9a3d66fd2fb5dab5de3228e0a1 (patch)
tree8977eb7c194edf5e53716f1645b309b8f00c8bf4 /docs
parent4d5513f3896841fa7865e440a812e6d6693101e2 (diff)
parent88a99dc8921967372182e0407e88c1a73eb6c374 (diff)
Merge pull request #1851 from therealadityashankar/improve-docs
added more explicit docs for certian key items (relevent github issue…
Diffstat (limited to 'docs')
-rw-r--r--docs/api.md2
-rw-r--r--docs/get-started.md21
2 files changed, 23 insertions, 0 deletions
diff --git a/docs/api.md b/docs/api.md
index 062343b..e178c18 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -109,6 +109,8 @@ If you provide `opts.store`, it will be called as
* `storeOpts.files` - an array of torrent file objects
* `storeOpts.torrent` - the torrent instance being stored
+**Note:** downloading a torrent automatically seeds it, allowing the user to also serve the file to others who need it
+
## `client.seed(input, [opts], [function onseed (torrent) {}])`
Start seeding a new torrent.
diff --git a/docs/get-started.md b/docs/get-started.md
index bee3b9d..4f0872a 100644
--- a/docs/get-started.md
+++ b/docs/get-started.md
@@ -63,6 +63,8 @@ Video and audio content can be streamed, i.e. playback will start before the ful
file is downloaded. Seeking works too – WebTorrent dynamically fetches
the needed torrent pieces from the network on-demand.
+**Note:** downloading a torrent automatically seeds it, allowing the user to also serve the file to other peers
+
### Creating a new torrent and seed it (in the browser)
```js
@@ -102,6 +104,25 @@ client.add(magnetURI, { path: '/path/to/folder' }, function (torrent) {
})
```
+### Creating a new torrent and seed it (in Node.js)
+
+**Note:** Seeding a torrent to be compatible with the browser (i.e. with support for WebRTC) requires [webtorrent-hybrid](https://github.com/webtorrent/webtorrent-hybrid) (note this requires Node version 12, 13 to work, Node v14 will NOT work with this module, lower node versions may also be supported)
+
+```js
+var WebTorrent = require('webtorrent-hybrid')
+var client = new WebTorrent()
+
+client.seed(__dirname + "/seedy.txt", function (torrent) {
+ console.log('Client is seeding ' + torrent.magnetURI)
+})
+```
+
+where **seedy.txt** is a text file which is going to be seeded as a torrent, such as
+
+```
+hi there, I'm gonna be seeded as a torrent !
+```
+
### Complete HTML page example
Looking for a more complete example? Look no further! This HTML example has a form input