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:
authorJulen Garcia Leunda <hicom150@gmail.com>2021-06-17 07:15:49 +0300
committerGitHub <noreply@github.com>2021-06-17 07:15:49 +0300
commit73c941c6eb3b539efbbbb499ab3d033531347b19 (patch)
treebe6333241137b452388f9a6548d033574f21c313 /index.js
parent711318d026b678948a3236aed5df8331d93b332c (diff)
fix: make utp-native optional (#1966)
* Add optional utp-native * Add error log when uTP cannot be loaded * Fix review suggestions * Remove an additional require call Co-authored-by: Alex <alxmorais8@msn.com>
Diffstat (limited to 'index.js')
-rw-r--r--index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/index.js b/index.js
index 692fe27..f92576a 100644
--- a/index.js
+++ b/index.js
@@ -74,7 +74,7 @@ class WebTorrent extends EventEmitter {
this.lsd = opts.lsd !== false
this.torrents = []
this.maxConns = Number(opts.maxConns) || 55
- this.utp = opts.utp === true
+ this.utp = WebTorrent.UTP_SUPPORT && opts.utp === true
this._debug(
'new webtorrent (peerId %s, nodeId %s, port %s)',
@@ -429,6 +429,7 @@ class WebTorrent extends EventEmitter {
}
WebTorrent.WEBRTC_SUPPORT = Peer.WEBRTC_SUPPORT
+WebTorrent.UTP_SUPPORT = ConnPool.UTP_SUPPORT
WebTorrent.VERSION = VERSION
/**