From 814b167e8a1022643e06bd4c1b291930793db635 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 23 Apr 2015 22:48:39 -0700 Subject: [PATCH] bittorrent-tracker/client should work if `wrtc` fails to install --- lib/websocket-tracker.js | 3 ++- package.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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"