diff --git a/docs/api.md b/docs/api.md index 2abf87dc..71f58ac4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -80,7 +80,7 @@ If `opts` is specified, then the default options (shown below) will be overridde { announce: [], // Torrent trackers to use (added to list in .torrent or magnet uri) getAnnounceOpts: Function, // Custom callback to allow sending extra parameters to the tracker - maxWebConns: Number, // Max number of simultaneous connections per web seed + maxWebConns: Number, // Max number of simultaneous connections per web seed [default=4] path: String, // Folder to download files to (default=`/tmp/webtorrent/`) store: Function // Custom chunk store (must follow [abstract-chunk-store](https://www.npmjs.com/package/abstract-chunk-store) API) } diff --git a/lib/torrent.js b/lib/torrent.js index 7f583c4f..622b58f6 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -75,7 +75,7 @@ function Torrent (torrentId, client, opts) { this.strategy = opts.strategy || 'sequential' - this.maxWebConns = opts.maxWebConns + this.maxWebConns = opts.maxWebConns || 4 this._rechokeNumSlots = (opts.uploads === false || opts.uploads === 0) ? 0