11 lines
332 B
JavaScript
11 lines
332 B
JavaScript
var dragDrop = require('drag-drop')
|
|
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 (torrent) {
|
|
console.log('Client is seeding:', torrent.infoHash)
|
|
})
|
|
}) |