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
diff options
context:
space:
mode:
authorJoseph Dykstra <josephdykstra@gmail.com>2015-01-17 01:45:13 +0300
committerJoseph Dykstra <josephdykstra@gmail.com>2015-01-17 01:45:13 +0300
commit777d6c2225a5fae5f514a141ea3ec25d97763754 (patch)
tree88a5d6d433e7ce9c9a0f0c995fbdafbdbf59378e /examples/browser-seed.js
parentd880b81ff83a860594a5310dd0a05fdb1ca7f876 (diff)
Added ./examples/ directory
Diffstat (limited to 'examples/browser-seed.js')
-rw-r--r--examples/browser-seed.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/browser-seed.js b/examples/browser-seed.js
new file mode 100644
index 0000000..6a6d498
--- /dev/null
+++ b/examples/browser-seed.js
@@ -0,0 +1,12 @@
+var dragDrop = require('drag-drop/buffer')
+var WebTorrent = require('webtorrent')
+
+var client = new WebTorrent()
+
+// When user drops files on the browser, create a new torrent and start seeding it!
+dragDrop('body', function (files) {
+ client.seed(files, function onTorrent (torrent) {
+ // Client is seeding the file!
+ console.log('Torrent info hash:', torrent.infoHash)
+ })
+})