diff --git a/lib/websocket-tracker.js b/lib/websocket-tracker.js index 4e9a2bd..f84b81b 100644 --- a/lib/websocket-tracker.js +++ b/lib/websocket-tracker.js @@ -11,7 +11,8 @@ var Socket = require('simple-websocket') var wrtc try { - wrtc = require('wrtc') // WebRTC in node/browser + wrtc = require('wrtc') // WebRTC in node - empty object in browser + if (!wrtc.RTCPeerConnection) wrtc = null } catch (err) { wrtc = null // optional dependency failed to install } diff --git a/package.json b/package.json index 5c203d7..cccbfb9 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "./lib/common-node": false, "./lib/http-tracker": false, "./lib/udp-tracker": false, - "./server": false + "./server": false, + "wrtc": false }, "bugs": { "url": "https://github.com/feross/bittorrent-tracker/issues"