diff options
author | Julen Garcia Leunda <hicom150@gmail.com> | 2021-06-17 07:15:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-17 07:15:49 +0300 |
commit | 73c941c6eb3b539efbbbb499ab3d033531347b19 (patch) | |
tree | be6333241137b452388f9a6548d033574f21c313 /index.js | |
parent | 711318d026b678948a3236aed5df8331d93b332c (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.js | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 /** |