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:
authorFeross Aboukhadijeh <feross@feross.org>2014-02-01 07:55:03 +0400
committerFeross Aboukhadijeh <feross@feross.org>2014-02-01 07:55:03 +0400
commitd6ffcc5d757c2dfdce13275998c8d23cdb4a9bd9 (patch)
treee146e36b83d8d29a2a34992bb2783db993dc62ae
parent53cf325eba0016dd3c91c52987e6626679e795c0 (diff)
fix scope bug
-rw-r--r--index.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/index.js b/index.js
index ed046c9..0b021e3 100644
--- a/index.js
+++ b/index.js
@@ -65,6 +65,9 @@ var displayName = magnetToDisplayName(magnetUri)
$('.infoHash span').text(infoHash)
$('.displayName span').text(displayName)
+var dht
+var swarm
+
async.auto({
dhtPort: function (cb) {
portfinder.getPort(cb)
@@ -73,7 +76,7 @@ async.auto({
portfinder.getPort(cb)
},
dht: ['dhtPort', function (cb, r) {
- var dht = new DHT(infoHash)
+ dht = new DHT(infoHash)
dht.on('node', function (node, infoHash) {
var num = Number($('.dhtNodes span').text())
@@ -94,7 +97,7 @@ async.auto({
// dht.listen(r.dhtPort)
}],
swarm: ['swarmPort', function (cb, r) {
- var swarm = new Swarm(infoHash, peerId, { dht: true })
+ swarm = new Swarm(infoHash, peerId, { dht: true })
// TODO: add swarm listen and add ourselves to the DHT