diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-01-04 12:12:54 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-01-04 12:13:16 +0300 |
commit | 35cace9d49b708c5088dd9270e2d83d368cfcd80 (patch) | |
tree | 47299a4ef84fa46c14d04daeb77a179db037cb5f | |
parent | e331573d853dfc031c877a3a7aee0603a6dd97c0 (diff) |
add `rtcConfig` option
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | index.js | 2 | ||||
-rw-r--r-- | lib/torrent.js | 3 |
3 files changed, 5 insertions, 1 deletions
@@ -237,6 +237,7 @@ If `opts` is specified, then the default options (shown below) will be overridde maxPeers: Number, // Max number of peers to connect to per torrent (default=100) nodeId: String|Buffer, // DHT protocol node ID (default=randomly generated) peerId: String|Buffer, // Wire protocol peer ID (default=randomly generated) + rtcConfig: Object, // RTCPeerConnection configuration object (default=STUN only) storage: Function // custom storage engine, or `false` to use in-memory engine tracker: Boolean, // Whether or not to enable trackers (default=true) verify: Boolean // Verify previously stored data before starting (default=false) @@ -44,6 +44,8 @@ function WebTorrent (opts) { self.torrentPort = opts.torrentPort || 0 self.tracker = opts.tracker !== undefined ? opts.tracker : true + self.rtcConfig = opts.rtcConfig + self.torrents = [] self.downloadSpeed = speedometer() diff --git a/lib/torrent.js b/lib/torrent.js index 83cd358..1ab3eb8 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -186,7 +186,8 @@ Torrent.prototype._onSwarmListening = function (port) { dht: self.client.dht, tracker: self.client.tracker, peerId: self.client.peerId, - port: port + port: port, + rtcConfig: self.client.rtcConfig }) self.discovery.setTorrent(self.infoHash) self.discovery.on('peer', self.addPeer.bind(self)) |