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:
authorJohn Hiesey <jhiesey@cs.stanford.edu>2013-10-28 11:38:17 +0400
committerJohn Hiesey <jhiesey@cs.stanford.edu>2013-10-28 11:38:17 +0400
commiteab8068c394668715c5eb8acbe385a4b98f930c6 (patch)
tree5ce05c4f7dd1fd8be0d2e9afcc9d6af7bb7fb070 /index.js
parent4a85701d72c91e384f1965bec0739136ef69ae22 (diff)
parent7e89116add42232e1f94650df492b1fb42724a10 (diff)
Merge branch 'master' of github.com:feross/webtorrent
Diffstat (limited to 'index.js')
-rw-r--r--index.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/index.js b/index.js
index b437154..d4f41bc 100644
--- a/index.js
+++ b/index.js
@@ -1,5 +1,8 @@
-window.log = function (data) {
- document.getElementById('console').innerHTML += data + '<br>'
+// window.log = function (data) {
+// document.getElementById('console').innerHTML += data + '<br>'
+// }
+window.log = function (/* ... */) {
+ if (process.env.DEBUG !== 'false') console.log.apply(console, arguments)
}
var isChromeApp = !!(window.chrome && chrome.app && chrome.app.runtime)
@@ -9,14 +12,19 @@ if (isChromeApp) {
window.bops = require('bops')
+var magnet = require('magnet-uri')
var DHT = require('./lib/bittorrent-dht')
-var leaves = 'D2474E86C95B19B8BCFDB92BC12C9D44667CFA36'
var pride = '1E69917FBAA2C767BCA463A96B5572785C6D8A12'
-var dht = new DHT(pride)
+var leaves = 'D2474E86C95B19B8BCFDB92BC12C9D44667CFA36'
+var leavesMagnet = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337'
+
+console.log(magnet(leavesMagnet))
+
+window.dht = new DHT(pride)
dht.on('node', function (node, infoHash) {
- log('node: ' + node)
+ // log('node: ' + node)
})
dht.on('peer', function (peer, infoHash) {
log('peer: ' + peer)