diff --git a/bt/client.js b/bt/client.js index f2904b6..6e56bab 100644 --- a/bt/client.js +++ b/bt/client.js @@ -7,14 +7,14 @@ var net = require('net'); var PeerQueue = require('./peer-queue'); var Wire = require('./wire'); const debug = require('debug')('downloader'); - +const config = require('../config') class Client extends Emiter { constructor(options) { super(); - this.timeout = 5000; - this.maxConnections = 200; + this.timeout = config.downloader.timeout; + this.maxConnections = config.downloader.maxConnections; this.activeConnections = 0; this.peers = new PeerQueue(this.maxConnections); this.on('download', this._download); diff --git a/config.js b/config.js index 2274209..85e9335 100644 --- a/config.js +++ b/config.js @@ -29,6 +29,11 @@ let config = { cpuInterval: 10, }, + downloader: { + maxConnections: 2000, + timeout: 5000 + } + cleanup: true, cleanupDiscLimit: 7 * 1024 * 1024 * 1024, spaceQuota: false,