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
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-01-04 12:12:54 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-01-04 12:13:16 +0300
commit35cace9d49b708c5088dd9270e2d83d368cfcd80 (patch)
tree47299a4ef84fa46c14d04daeb77a179db037cb5f
parente331573d853dfc031c877a3a7aee0603a6dd97c0 (diff)
add `rtcConfig` option
-rw-r--r--README.md1
-rw-r--r--index.js2
-rw-r--r--lib/torrent.js3
3 files changed, 5 insertions, 1 deletions
diff --git a/README.md b/README.md
index 9699039..a4a76c5 100644
--- a/README.md
+++ b/README.md
@@ -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)
diff --git a/index.js b/index.js
index dae3a9c..0d83b7b 100644
--- a/index.js
+++ b/index.js
@@ -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))