You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
566 B
24 lines
566 B
![]()
7 years ago
|
var Protocol = require('bittorrent-protocol');
|
||
|
var stream = require('stream');
|
||
|
var WebSocks = require("./websocks.js").WebSocks;
|
||
|
|
||
|
|
||
|
function start_torrent(torrent_file_blob)
|
||
|
{
|
||
|
var torrent = new WebsocksTorrent();
|
||
|
var elem = document.getElementById("ws-server");
|
||
|
torrent.start(elem.value);
|
||
|
torrent.addTorrent(torrent_file_blob);
|
||
|
}
|
||
|
|
||
|
function start_downloading()
|
||
|
{
|
||
|
var elem = document.getElementById("torrent-file");
|
||
|
var files = elem.files;
|
||
|
for (var f of files) {
|
||
|
if(f.slice) {
|
||
|
start_torrent(f.slice());
|
||
|
}
|
||
|
}
|
||
|
}
|