diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-01-04 06:59:36 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-01-04 06:59:36 +0300 |
commit | 5c78cf25fe40f8b88680559ddbdbbc7a3f004a25 (patch) | |
tree | dadc1e265bb636fa044ca1980ad384f863064a49 /lib | |
parent | 09e345eb12f30f73e9492c7a6921a4442226e38e (diff) |
remove concat-stream dep
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index bf110f9..83cd358 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1,7 +1,6 @@ module.exports = Torrent var addrToIPPort = require('addr-to-ip-port') // browser exclude -var concat = require('concat-stream') // browser exclude var debug = require('debug')('webtorrent:torrent') var Discovery = require('torrent-discovery') var EventEmitter = require('events').EventEmitter @@ -79,13 +78,13 @@ function Torrent (torrentId, opts) { } else if (typeof get === 'function' && /^https?:/.test(torrentId)) { // http or https url to torrent file - get({ + get.concat({ url: torrentId, headers: { 'user-agent': 'WebTorrent (http://webtorrent.io)' } - }, function (err, res) { + }, function (err, data) { if (err) return self.emit('error', new Error('error downloading torrent: ' + err.message)) - res.pipe(concat(onTorrentId)) + onTorrentId(data) }) } else if (typeof fs.readFile === 'function') { |