diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api.md | 2 | ||||
-rw-r--r-- | docs/faq.md | 9 | ||||
-rw-r--r-- | docs/get-started.md | 23 |
3 files changed, 32 insertions, 2 deletions
diff --git a/docs/api.md b/docs/api.md index 98bdb1c..1532a89 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/faq.md b/docs/faq.md index 56f6752..c2db25a 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -100,6 +100,9 @@ WebTorrent is still pretty new, but it's already being used in cool ways: - **[P2P Media Loader][p2p-media-loader]** - engine for Hls.js and Shaka Player that enables P2P sharing of live and VOD streams over HLS or DASH protocols. - **[Hubzilla][hubzilla]** - WebTorrent player integration into posts ([source code][hubzilla-source]) - **[Come Over][comeover]** - Video stream sharing to watch movies together. +- **[PeerWebSite][peerwebsite]** - Peer to Peer Web Site hosting at your fingertips! Send full featured HTML (incl. CSS, JS) sites from your browser and attach files eg. videos, images, etc. +- **[CipherTorrent][cipher-torrent]** - Online and offline browser torrent client ([source code][cipher-torrent-source]) +- **[Slingcode][Slingcode]** - make, run, and share web apps P2P in the browser. - ***Your app here – [Send a pull request][pr] with your URL!*** <!-- - **[PeerCloud][peercloud]** - Serverless websites via WebTorrent ([source code][peercloud-source]) --> <!-- - **[Niagara][niagara]** - Video player webtorrent with subtitles (zipped .srt(s)) --> @@ -172,10 +175,14 @@ There's also a list of WebTorrent-powered alternatives to centralized services h [Files.fm]: https://files.fm [imgest]: https://imgest.hashbase.io [Bugout]: https://github.com/chr15m/bugout +[Slingcode]: https://github.com/chr15m/slingcode [p2p-media-loader]: https://github.com/novage/p2p-media-loader [hubzilla]: https://hubzilla.org [hubzilla-source]: https://github.com/demitas-ace/wtplayer/tree/master/wtplayer -[comeover]: https://comeover.io +[comeover]: https://www.comeover.io +[peerwebsite]: https://peerweb.site +[cipher-torrent]: https://torrent.cipherdogs.net +[cipher-torrent-source]: https://github.com/CipherDogs/cipher-torrent ## How does WebTorrent work? diff --git a/docs/get-started.md b/docs/get-started.md index 362e8fe..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 @@ -83,7 +85,7 @@ This example uses the [`drag-drop`][drag-drop] package, to make the HTML5 Drag a Drop API easier to work with. **Note:** If you do not use browserify, use the standalone file -[`dragdrop.min.js`](https://raw.githubusercontent.com/feross/drag-drop/master/dragdrop.min.js). +[`dragdrop.min.js`](https://bundle.run/drag-drop). This exports a `DragDrop` function on `window`. ### Download and save a torrent (in Node.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 |