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
path: root/test
diff options
context:
space:
mode:
authorJulen Garcia Leunda <hicom150@gmail.com>2020-11-12 19:06:59 +0300
committerJulen Garcia Leunda <hicom150@gmail.com>2020-11-12 19:06:59 +0300
commit7c34ba107a094f170385c8a387a254b46052e9c7 (patch)
tree4ab77343360ff1c68274f2da1c149102599ddd62 /test
parent21fb2f8e02eaadaef3108a73a9dfd4579de74a6c (diff)
Fix tests disabling lsd option
Diffstat (limited to 'test')
-rw-r--r--test/browser/basic.js10
-rw-r--r--test/client-add-duplicate-trackers.js6
-rw-r--r--test/client-add.js18
-rw-r--r--test/client-destroy.js4
-rw-r--r--test/client-remove.js2
-rw-r--r--test/client-seed.js6
-rw-r--r--test/duplicate.js10
-rw-r--r--test/node/basic.js18
-rw-r--r--test/node/blocklist-dht.js2
-rw-r--r--test/node/blocklist-tracker.js3
-rw-r--r--test/node/blocklist.js8
-rw-r--r--test/node/conn-pool.js16
-rw-r--r--test/node/download-dht-magnet.js2
-rw-r--r--test/node/download-dht-torrent.js2
-rw-r--r--test/node/download-from-ip.js8
-rw-r--r--test/node/download-lsd-magnet.js37
-rw-r--r--test/node/download-lsd-torrent.js37
-rw-r--r--test/node/download-metadata.js10
-rw-r--r--test/node/download-private-dht.js5
-rw-r--r--test/node/download-tracker-magnet.js4
-rw-r--r--test/node/download-tracker-torrent.js4
-rw-r--r--test/node/download-webseed-magnet.js4
-rw-r--r--test/node/download-webseed-torrent.js4
-rw-r--r--test/node/extensions.js4
-rw-r--r--test/node/metadata.js4
-rw-r--r--test/node/seed-stream.js4
-rw-r--r--test/node/seed-while-download.js2
-rw-r--r--test/node/server.js2
-rw-r--r--test/node/torrent-events.js6
-rw-r--r--test/rarity-map.js1
-rw-r--r--test/torrent-destroy.js2
31 files changed, 171 insertions, 74 deletions
diff --git a/test/browser/basic.js b/test/browser/basic.js
index fcdcc80..b17b0a1 100644
--- a/test/browser/basic.js
+++ b/test/browser/basic.js
@@ -20,7 +20,7 @@ if (!(global && global.process && global.process.versions && global.process.vers
test('image append w/ query selector', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -38,7 +38,7 @@ if (!(global && global.process && global.process.versions && global.process.vers
test('image append w/ element', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -56,7 +56,7 @@ if (!(global && global.process && global.process.versions && global.process.vers
test('image render w/ query selector', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -78,7 +78,7 @@ if (!(global && global.process && global.process.versions && global.process.vers
test('image render w/ element', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -100,7 +100,7 @@ if (!(global && global.process && global.process.versions && global.process.vers
test('WebTorrent.WEBRTC_SUPPORT', function (t) {
t.plan(2)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/client-add-duplicate-trackers.js b/test/client-add-duplicate-trackers.js
index 46246fd..4c32714 100644
--- a/test/client-add-duplicate-trackers.js
+++ b/test/client-add-duplicate-trackers.js
@@ -5,7 +5,7 @@ const WebTorrent = require('../')
test('client.add: duplicate trackers', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -29,7 +29,7 @@ test('client.add: duplicate trackers, with multiple torrents', function (t) {
announce: ['wss://example.com', 'wss://example.com', 'wss://example.com']
}
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -66,7 +66,7 @@ test('client.add: duplicate trackers (including in .torrent file), multiple torr
const parsedTorrentAlice = Object.assign({}, fixtures.alice.parsedTorrent)
parsedTorrentAlice.announce = ['wss://example.com', 'wss://example.com', 'wss://example.com']
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/client-add.js b/test/client-add.js
index a016584..beced07 100644
--- a/test/client-add.js
+++ b/test/client-add.js
@@ -5,7 +5,7 @@ const WebTorrent = require('../')
test('client.add: magnet uri, utf-8 string', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -27,7 +27,7 @@ test('client.add: magnet uri, utf-8 string', function (t) {
test('client.add: torrent file, buffer', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -49,7 +49,7 @@ test('client.add: torrent file, buffer', function (t) {
test('client.add: info hash, hex string', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -71,7 +71,7 @@ test('client.add: info hash, hex string', function (t) {
test('client.add: info hash, buffer', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -93,7 +93,7 @@ test('client.add: info hash, buffer', function (t) {
test('client.add: parsed torrent, from `parse-torrent`', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -115,7 +115,7 @@ test('client.add: parsed torrent, from `parse-torrent`', function (t) {
test('client.add: parsed torrent, with string type announce property', function (t) {
t.plan(7)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -146,7 +146,7 @@ test('client.add: parsed torrent, with string type announce property', function
test('client.add: parsed torrent, with array type announce property', function (t) {
t.plan(7)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -177,7 +177,7 @@ test('client.add: parsed torrent, with array type announce property', function (
test('client.add: invalid torrent id: empty string', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) {
t.ok(err instanceof Error)
@@ -193,7 +193,7 @@ test('client.add: invalid torrent id: empty string', function (t) {
test('client.add: invalid torrent id: short buffer', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) {
t.ok(err instanceof Error)
diff --git a/test/client-destroy.js b/test/client-destroy.js
index eaf6c70..b42a25e 100644
--- a/test/client-destroy.js
+++ b/test/client-destroy.js
@@ -5,7 +5,7 @@ const WebTorrent = require('../')
test('after client.destroy(), throw on client.add() or client.seed()', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -23,7 +23,7 @@ test('after client.destroy(), throw on client.add() or client.seed()', function
test('after client.destroy(), no "torrent" or "ready" events emitted', function (t) {
t.plan(1)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/client-remove.js b/test/client-remove.js
index 9a03c63..6653ec1 100644
--- a/test/client-remove.js
+++ b/test/client-remove.js
@@ -5,7 +5,7 @@ const WebTorrent = require('../')
test('client.remove: remove by Torrent object', function (t) {
t.plan(5)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/client-seed.js b/test/client-seed.js
index d95b2b8..3d77b56 100644
--- a/test/client-seed.js
+++ b/test/client-seed.js
@@ -7,7 +7,7 @@ const WebTorrent = require('../')
test('client.seed: torrent file (Buffer)', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -30,7 +30,7 @@ test('client.seed: torrent file (Buffer)', function (t) {
test('client.seed: torrent file (Buffer), set name on buffer', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -55,7 +55,7 @@ test('client.seed: torrent file (Blob)', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/duplicate.js b/test/duplicate.js
index e8cdef7..3a9d795 100644
--- a/test/duplicate.js
+++ b/test/duplicate.js
@@ -5,7 +5,7 @@ const WebTorrent = require('../')
test('client.seed followed by duplicate client.add (sync)', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -36,7 +36,7 @@ test('client.seed followed by duplicate client.add (sync)', function (t) {
test('client.seed followed by duplicate client.add (async)', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -67,7 +67,7 @@ test('client.seed followed by duplicate client.add (async)', function (t) {
test('client.seed followed by two duplicate client.add calls (sync)', function (t) {
t.plan(9)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -110,7 +110,7 @@ test('client.seed followed by two duplicate client.add calls (sync)', function (
test('client.seed followed by two duplicate client.add calls (async)', function (t) {
t.plan(9)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -153,7 +153,7 @@ test('client.seed followed by two duplicate client.add calls (async)', function
test('successive sync client.add, client.remove, client.add, client.remove (sync)', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/basic.js b/test/node/basic.js
index a0598b8..963a05c 100644
--- a/test/node/basic.js
+++ b/test/node/basic.js
@@ -8,7 +8,7 @@ const WebTorrent = require('../../')
test('WebTorrent.WEBRTC_SUPPORT', function (t) {
t.plan(2)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -31,7 +31,7 @@ test('client.add: http url to a torrent file, string', function (t) {
server.listen(0, function () {
const port = server.address().port
const url = 'http://127.0.0.1:' + port
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -53,7 +53,7 @@ test('client.add: http url to a torrent file, string', function (t) {
test('client.add: filesystem path to a torrent file, string', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -73,7 +73,7 @@ test('client.add: filesystem path to a torrent file, string', function (t) {
test('client.seed: filesystem path to file, string', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -96,7 +96,7 @@ test('client.seed: filesystem path to file, string', function (t) {
test('client.seed: filesystem path to folder with one file, string', function (t) {
t.plan(6)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -116,7 +116,7 @@ test('client.seed: filesystem path to folder with one file, string', function (t
test('client.seed: filesystem path to folder with multiple files, string', function (t) {
t.plan(7)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -147,7 +147,7 @@ test('client.seed: filesystem path to folder with multiple files, string', funct
test('client.add: invalid torrent id: invalid filesystem path', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) {
t.ok(err instanceof Error)
@@ -163,7 +163,7 @@ test('client.add: invalid torrent id: invalid filesystem path', function (t) {
test('client.remove: opts.destroyStore', function (t) {
t.plan(2)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -186,7 +186,7 @@ test('client.remove: opts.destroyStore', function (t) {
test('torrent.destroy: opts.destroyStore', function (t) {
t.plan(2)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/blocklist-dht.js b/test/node/blocklist-dht.js
index 2ecec36..d718d6e 100644
--- a/test/node/blocklist-dht.js
+++ b/test/node/blocklist-dht.js
@@ -24,6 +24,7 @@ test('blocklist blocks peers discovered via DHT', function (t) {
client1 = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
client1.on('error', function (err) { t.fail(err) })
@@ -61,6 +62,7 @@ test('blocklist blocks peers discovered via DHT', function (t) {
function (cb) {
client2 = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port },
blocklist: ['127.0.0.1']
})
diff --git a/test/node/blocklist-tracker.js b/test/node/blocklist-tracker.js
index 74d831d..8633685 100644
--- a/test/node/blocklist-tracker.js
+++ b/test/node/blocklist-tracker.js
@@ -35,7 +35,7 @@ test('blocklist blocks peers discovered via tracker', function (t) {
},
function (cb) {
- client1 = new WebTorrent({ dht: false })
+ client1 = new WebTorrent({ dht: false, lsd: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
@@ -56,6 +56,7 @@ test('blocklist blocks peers discovered via tracker', function (t) {
function (cb) {
client2 = new WebTorrent({
dht: false,
+ lsd: false,
blocklist: ['127.0.0.1']
})
client2.on('error', function (err) { t.fail(err) })
diff --git a/test/node/blocklist.js b/test/node/blocklist.js
index 6a5af5e..4ff686a 100644
--- a/test/node/blocklist.js
+++ b/test/node/blocklist.js
@@ -25,6 +25,7 @@ test('blocklist (single IP)', function (t) {
const client = new WebTorrent({
dht: false,
tracker: false,
+ lsd: false,
blocklist: ['1.2.3.4']
})
client.on('error', function (err) { t.fail(err) })
@@ -51,6 +52,7 @@ test('blocklist (array of IPs)', function (t) {
const client = new WebTorrent({
dht: false,
tracker: false,
+ lsd: false,
blocklist: ['1.2.3.4', '5.6.7.8']
})
.on('error', function (err) { t.fail(err) })
@@ -115,6 +117,7 @@ test('blocklist (array of IP ranges)', function (t) {
const client = new WebTorrent({
dht: false,
tracker: false,
+ lsd: false,
blocklist: [
{ start: '1.2.3.0', end: '1.2.3.255' },
{ start: '5.6.7.0', end: '5.6.7.255' }
@@ -147,6 +150,7 @@ test('blocklist (http url)', function (t) {
const client = new WebTorrent({
dht: false,
tracker: false,
+ lsd: false,
blocklist: url
})
.on('error', function (err) { t.fail(err) })
@@ -183,6 +187,7 @@ test('blocklist (http url with gzip encoding)', function (t) {
const client = new WebTorrent({
dht: false,
tracker: false,
+ lsd: false,
blocklist: url
})
.on('error', function (err) { t.fail(err) })
@@ -219,6 +224,7 @@ test('blocklist (http url with deflate encoding)', function (t) {
const client = new WebTorrent({
dht: false,
tracker: false,
+ lsd: false,
blocklist: url
})
.on('error', function (err) { t.fail(err) })
@@ -242,6 +248,7 @@ test('blocklist (fs path)', function (t) {
const client = new WebTorrent({
dht: false,
tracker: false,
+ lsd: false,
blocklist: fixtures.blocklist.path
})
.on('error', function (err) { t.fail(err) })
@@ -261,6 +268,7 @@ test('blocklist (fs path with gzip)', function (t) {
const client = new WebTorrent({
dht: false,
tracker: false,
+ lsd: false,
blocklist: fixtures.blocklist.gzipPath
})
.on('error', function (err) { t.fail(err) })
diff --git a/test/node/conn-pool.js b/test/node/conn-pool.js
index 9a53f91..a4850f2 100644
--- a/test/node/conn-pool.js
+++ b/test/node/conn-pool.js
@@ -7,8 +7,8 @@ const dgram = require('dgram')
test('client.conn-pool: use TCP when uTP disabled', function (t) {
t.plan(6)
- const client1 = new WebTorrent({ dht: false, tracker: false, utp: false })
- const client2 = new WebTorrent({ dht: false, tracker: false, utp: false })
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: false, utp: false })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: false, utp: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
@@ -55,8 +55,8 @@ test('client.conn-pool: use TCP when uTP disabled', function (t) {
test('client.conn-pool: use uTP when uTP enabled', function (t) {
t.plan(6)
- const client1 = new WebTorrent({ dht: false, tracker: false, utp: true })
- const client2 = new WebTorrent({ dht: false, tracker: false, utp: true })
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: false, utp: true })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: false, utp: true })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
@@ -108,8 +108,8 @@ test('client.conn-pool: fallback to TCP when uTP server failed', function (t) {
const server = dgram.createSocket('udp4')
server.bind(63000)
- const client1 = new WebTorrent({ dht: false, tracker: false, utp: true, torrentPort: 63000 })
- const client2 = new WebTorrent({ dht: false, tracker: false, utp: false })
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: false, utp: true, torrentPort: 63000 })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: false, utp: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
@@ -159,8 +159,8 @@ test('client.conn-pool: fallback to TCP when uTP server failed', function (t) {
test('client.conn-pool: fallback to TCP when remote client has uTP disabled', function (t) {
t.plan(6)
- const client1 = new WebTorrent({ dht: false, tracker: false, utp: true })
- const client2 = new WebTorrent({ dht: false, tracker: false, utp: false })
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: false, utp: true })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: false, utp: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/download-dht-magnet.js b/test/node/download-dht-magnet.js
index 5b84b11..199d5bc 100644
--- a/test/node/download-dht-magnet.js
+++ b/test/node/download-dht-magnet.js
@@ -28,6 +28,7 @@ test('Download using DHT (via magnet uri)', function (t) {
client1 = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port, host: networkAddress.ipv4() }
})
@@ -71,6 +72,7 @@ test('Download using DHT (via magnet uri)', function (t) {
client2 = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port, host: networkAddress.ipv4() }
})
diff --git a/test/node/download-dht-torrent.js b/test/node/download-dht-torrent.js
index c8b8219..8ecbbed 100644
--- a/test/node/download-dht-torrent.js
+++ b/test/node/download-dht-torrent.js
@@ -28,6 +28,7 @@ test('Download using DHT (via .torrent file)', function (t) {
client1 = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
@@ -72,6 +73,7 @@ test('Download using DHT (via .torrent file)', function (t) {
function (cb) {
client2 = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
diff --git a/test/node/download-from-ip.js b/test/node/download-from-ip.js
index b7334e1..ba25d41 100644
--- a/test/node/download-from-ip.js
+++ b/test/node/download-from-ip.js
@@ -9,7 +9,7 @@ test('Download via torrent.addPeer()', (t) => {
// if initial interest isn't set, then this test is delayed
t.timeoutAfter(5000)
- const seeder = new WebTorrent({ tracker: false, dht: false })
+ const seeder = new WebTorrent({ tracker: false, dht: false, lsd: false })
seeder.on('error', (err) => t.fail(err))
seeder.on('warning', (err) => t.fail(err))
@@ -29,7 +29,7 @@ test('Download via torrent.addPeer()', (t) => {
// torrent data now loaded into seeder
- const downloader = new WebTorrent({ tracker: false, dht: false })
+ const downloader = new WebTorrent({ tracker: false, dht: false, lsd: false })
downloader.on('error', function (err) { t.fail(err) })
downloader.on('warning', function (err) { t.fail(err) })
@@ -58,7 +58,7 @@ test('Download via magnet x.pe (BEP09)', (t) => {
// if initial interest isn't set, then this test is delayed
t.timeoutAfter(5000)
- const seeder = new WebTorrent({ tracker: false, dht: false, torrentPort: 63000 })
+ const seeder = new WebTorrent({ tracker: false, dht: false, lsd: false, torrentPort: 63000 })
seeder.on('error', (err) => t.fail(err))
seeder.on('warning', (err) => t.fail(err))
@@ -78,7 +78,7 @@ test('Download via magnet x.pe (BEP09)', (t) => {
// torrent data now loaded into seeder
- const downloader = new WebTorrent({ tracker: false, dht: false })
+ const downloader = new WebTorrent({ tracker: false, dht: false, lsd: false })
downloader.on('error', function (err) { t.fail(err) })
downloader.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/download-lsd-magnet.js b/test/node/download-lsd-magnet.js
new file mode 100644
index 0000000..bbf9d32
--- /dev/null
+++ b/test/node/download-lsd-magnet.js
@@ -0,0 +1,37 @@
+const fixtures = require('webtorrent-fixtures')
+const MemoryChunkStore = require('memory-chunk-store')
+const test = require('tape')
+const WebTorrent = require('../../')
+
+test('Download using LSD (via magnet uri)', function (t) {
+ t.plan(3)
+
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: true })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: true })
+
+ client1.on('error', function (err) { t.fail(err) })
+ client1.on('warning', function (err) { t.fail(err) })
+
+ client2.on('error', function (err) { t.fail(err) })
+ client2.on('warning', function (err) { t.fail(err) })
+
+ // Start seeding
+ client2.seed(fixtures.leaves.content, {
+ name: 'Leaves of Grass by Walt Whitman.epub',
+ announce: []
+ }, function (torrent) {
+ torrent.discovery.lsd._announce() // hack to send a lsd announce skipping 5min interval
+ })
+
+ client2.on('listening', function () {
+ // Start downloading
+ const torrent = client1.add(fixtures.leaves.magnetURI, { store: MemoryChunkStore })
+
+ torrent.on('done', function () {
+ t.pass()
+
+ client1.destroy(function (err) { t.error(err, 'client 1 destroyed') })
+ client2.destroy(function (err) { t.error(err, 'client 2 destroyed') })
+ })
+ })
+})
diff --git a/test/node/download-lsd-torrent.js b/test/node/download-lsd-torrent.js
new file mode 100644
index 0000000..163069d
--- /dev/null
+++ b/test/node/download-lsd-torrent.js
@@ -0,0 +1,37 @@
+const fixtures = require('webtorrent-fixtures')
+const MemoryChunkStore = require('memory-chunk-store')
+const test = require('tape')
+const WebTorrent = require('../../')
+
+test('Download using LSD (via .torrent file)', function (t) {
+ t.plan(3)
+
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: true })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: true })
+
+ client1.on('error', function (err) { t.fail(err) })
+ client1.on('warning', function (err) { t.fail(err) })
+
+ client2.on('error', function (err) { t.fail(err) })
+ client2.on('warning', function (err) { t.fail(err) })
+
+ // Start seeding
+ client2.seed(fixtures.leaves.content, {
+ name: 'Leaves of Grass by Walt Whitman.epub',
+ announce: []
+ }, function (torrent) {
+ torrent.discovery.lsd._announce() // // hack to send a lsd announce skipping 5min interval
+ })
+
+ client2.on('torrent', function () {
+ // Start downloading
+ const torrent = client1.add(fixtures.leaves.parsedTorrent, { store: MemoryChunkStore })
+
+ torrent.on('done', function () {
+ t.pass()
+
+ client1.destroy(function (err) { t.error(err, 'client 1 destroyed') })
+ client2.destroy(function (err) { t.error(err, 'client 2 destroyed') })
+ })
+ })
+})
diff --git a/test/node/download-metadata.js b/test/node/download-metadata.js
index 4f3604f..4932a53 100644
--- a/test/node/download-metadata.js
+++ b/test/node/download-metadata.js
@@ -26,7 +26,7 @@ function createServer (data, cb) {
test('Download metadata for magnet URI with xs parameter', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -44,7 +44,7 @@ test('Download metadata for magnet URI with xs parameter', function (t) {
test('Download metadata for magnet URI with 2 xs parameters', function (t) {
t.plan(4)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -70,7 +70,7 @@ test('Download metadata for magnet URI with 2 xs parameters', function (t) {
test('Download metadata for magnet URI with 2 xs parameters, with 1 invalid protocol', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -91,7 +91,7 @@ test('Download metadata for magnet URI with 2 xs parameters, with 1 invalid prot
test('Download metadata for magnet URI with 2 xs parameters, with 1 404 URL', function (t) {
t.plan(3)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -112,7 +112,7 @@ test('Download metadata for magnet URI with 2 xs parameters, with 1 404 URL', fu
test('Download metadata magnet URI with unsupported protocol in xs parameter', function (t) {
t.plan(1)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/download-private-dht.js b/test/node/download-private-dht.js
index b13f494..036c889 100644
--- a/test/node/download-private-dht.js
+++ b/test/node/download-private-dht.js
@@ -23,6 +23,7 @@ test('private torrent should not use DHT', function (t) {
function (cb) {
client = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
@@ -72,8 +73,10 @@ test('public torrent should use DHT', function (t) {
function (cb) {
client = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
+
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -120,6 +123,7 @@ test('public torrent with forced private option should not use DHT', function (t
function (cb) {
client = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
@@ -172,6 +176,7 @@ test('private torrent with forced public option should use DHT', function (t) {
function (cb) {
client = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
diff --git a/test/node/download-tracker-magnet.js b/test/node/download-tracker-magnet.js
index 646de4a..4e13e6a 100644
--- a/test/node/download-tracker-magnet.js
+++ b/test/node/download-tracker-magnet.js
@@ -46,7 +46,7 @@ function magnetDownloadTest (t, serverType) {
parsedTorrent.announce = [announceUrl]
magnetURI = 'magnet:?xt=urn:btih:' + parsedTorrent.infoHash + '&tr=' + encodeURIComponent(announceUrl)
- client1 = new WebTorrent({ dht: false })
+ client1 = new WebTorrent({ dht: false, lsd: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
@@ -74,7 +74,7 @@ function magnetDownloadTest (t, serverType) {
},
function (cb) {
- client2 = new WebTorrent({ dht: false })
+ client2 = new WebTorrent({ dht: false, lsd: false })
client2.on('error', function (err) { t.fail(err) })
client2.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/download-tracker-torrent.js b/test/node/download-tracker-torrent.js
index d3ff0ca..c1d3bcd 100644
--- a/test/node/download-tracker-torrent.js
+++ b/test/node/download-tracker-torrent.js
@@ -39,7 +39,7 @@ function torrentDownloadTest (t, serverType) {
},
function (cb) {
- client1 = new WebTorrent({ dht: false })
+ client1 = new WebTorrent({ dht: false, lsd: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
@@ -69,7 +69,7 @@ function torrentDownloadTest (t, serverType) {
},
function (cb) {
- client2 = new WebTorrent({ dht: false })
+ client2 = new WebTorrent({ dht: false, lsd: false })
client2.on('error', function (err) { t.fail(err) })
client2.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/download-webseed-magnet.js b/test/node/download-webseed-magnet.js
index e73285a..4963cf2 100644
--- a/test/node/download-webseed-magnet.js
+++ b/test/node/download-webseed-magnet.js
@@ -26,7 +26,7 @@ test('Download using webseed (via magnet uri)', function (t) {
},
function (cb) {
- client1 = new WebTorrent({ dht: false, tracker: false })
+ client1 = new WebTorrent({ dht: false, tracker: false, lsd: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
@@ -61,7 +61,7 @@ test('Download using webseed (via magnet uri)', function (t) {
},
function (cb) {
- client2 = new WebTorrent({ dht: false, tracker: false })
+ client2 = new WebTorrent({ dht: false, tracker: false, lsd: false })
client2.on('error', function (err) { t.fail(err) })
client2.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/download-webseed-torrent.js b/test/node/download-webseed-torrent.js
index cc0dec4..0a5c83d 100644
--- a/test/node/download-webseed-torrent.js
+++ b/test/node/download-webseed-torrent.js
@@ -35,7 +35,7 @@ test('Download using webseed (via .torrent file)', function (t) {
'http://localhost:' + httpServer.address().port + '/' + fixtures.leaves.parsedTorrent.name
]
- client = new WebTorrent({ dht: false, tracker: false })
+ client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
@@ -97,7 +97,7 @@ test('Disable webseeds', function (t) {
'http://localhost:' + httpServer.address().port + '/' + fixtures.leaves.parsedTorrent.name
]
- client = new WebTorrent({ dht: false, tracker: false, webSeeds: false })
+ client = new WebTorrent({ dht: false, tracker: false, lsd: false, webSeeds: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/extensions.js b/test/node/extensions.js
index 729d1c5..35b4ac9 100644
--- a/test/node/extensions.js
+++ b/test/node/extensions.js
@@ -29,12 +29,12 @@ test('extension support', function (t) {
}
}
- const client1 = new WebTorrent({ dht: false, tracker: false })
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
- const client2 = new WebTorrent({ dht: false, tracker: false })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: false })
client2.on('error', function (err) { t.fail(err) })
client2.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/metadata.js b/test/node/metadata.js
index 121e858..106586d 100644
--- a/test/node/metadata.js
+++ b/test/node/metadata.js
@@ -5,8 +5,8 @@ const WebTorrent = require('../../')
test('ut_metadata transfer', function (t) {
t.plan(6)
- const client1 = new WebTorrent({ dht: false, tracker: false })
- const client2 = new WebTorrent({ dht: false, tracker: false })
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: false })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/seed-stream.js b/test/node/seed-stream.js
index 3e973b6..fda91d7 100644
--- a/test/node/seed-stream.js
+++ b/test/node/seed-stream.js
@@ -23,7 +23,7 @@ test('client.seed: stream', function (t) {
const port = tracker.http.address().port
announceUrl = 'http://localhost:' + port + '/announce'
- seeder = new WebTorrent({ dht: false })
+ seeder = new WebTorrent({ dht: false, lsd: false })
seeder.on('error', function (err) { t.fail(err) })
seeder.on('warning', function (err) { t.fail(err) })
@@ -45,7 +45,7 @@ test('client.seed: stream', function (t) {
},
function (cb) {
- client = new WebTorrent({ dht: false })
+ client = new WebTorrent({ dht: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/seed-while-download.js b/test/node/seed-while-download.js
index 961b4db..cfbb36f 100644
--- a/test/node/seed-while-download.js
+++ b/test/node/seed-while-download.js
@@ -27,6 +27,7 @@ test('Seed and download a file at the same time', function (t) {
client1 = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
@@ -58,6 +59,7 @@ test('Seed and download a file at the same time', function (t) {
client2 = new WebTorrent({
tracker: false,
+ lsd: false,
dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }
})
diff --git a/test/node/server.js b/test/node/server.js
index c40bd93..2da0f60 100644
--- a/test/node/server.js
+++ b/test/node/server.js
@@ -7,7 +7,7 @@ const WebTorrent = require('../../')
test('torrent.createServer: programmatic http server', function (t) {
t.plan(9)
- const client = new WebTorrent({ tracker: false, dht: false })
+ const client = new WebTorrent({ tracker: false, dht: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/node/torrent-events.js b/test/node/torrent-events.js
index 35aabfa..be2adbc 100644
--- a/test/node/torrent-events.js
+++ b/test/node/torrent-events.js
@@ -6,8 +6,8 @@ const MemoryChunkStore = require('memory-chunk-store')
test('client.add: emit torrent events in order', function (t) {
t.plan(6)
- const client1 = new WebTorrent({ dht: false, tracker: false })
- const client2 = new WebTorrent({ dht: false, tracker: false })
+ const client1 = new WebTorrent({ dht: false, tracker: false, lsd: false })
+ const client2 = new WebTorrent({ dht: false, tracker: false, lsd: false })
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
@@ -54,7 +54,7 @@ test('client.add: emit torrent events in order', function (t) {
test('client.seed: emit torrent events in order', function (t) {
t.plan(5)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
diff --git a/test/rarity-map.js b/test/rarity-map.js
index 6c5ec1e..03a9985 100644
--- a/test/rarity-map.js
+++ b/test/rarity-map.js
@@ -17,6 +17,7 @@ test('Rarity map usage', function (t) {
torrentPort: 6889,
dht: false,
tracker: false,
+ lsd: false,
_remove: function () {}
}
const opts = {}
diff --git a/test/torrent-destroy.js b/test/torrent-destroy.js
index 5894627..5795405 100644
--- a/test/torrent-destroy.js
+++ b/test/torrent-destroy.js
@@ -5,7 +5,7 @@ const WebTorrent = require('../')
test('torrent.destroy: destroy and remove torrent', function (t) {
t.plan(5)
- const client = new WebTorrent({ dht: false, tracker: false })
+ const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })