mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-31 02:21:36 +00:00
Better WebRTC detection
Before, any environment with a `window` would be detected as supporting WebRTC.
This commit is contained in:
parent
0d9ee4c93a
commit
c648f2e5e6
@ -6,6 +6,7 @@ var extend = require('xtend')
|
||||
var inherits = require('inherits')
|
||||
var once = require('once')
|
||||
var parallel = require('run-parallel')
|
||||
var Peer = require('simple-peer')
|
||||
var uniq = require('uniq')
|
||||
var url = require('url')
|
||||
|
||||
@ -64,7 +65,7 @@ function Client (opts) {
|
||||
|
||||
debug('new client %s', self.infoHash)
|
||||
|
||||
var webrtcSupport = self._wrtc !== false && (!!self._wrtc || typeof window !== 'undefined')
|
||||
var webrtcSupport = self._wrtc !== false && (!!self._wrtc || Peer.WEBRTC_SUPPORT)
|
||||
|
||||
var announce = (typeof opts.announce === 'string')
|
||||
? [ opts.announce ]
|
||||
|
Loading…
Reference in New Issue
Block a user