diff --git a/lib/transports/websocket.js b/lib/transports/websocket.js index 4964fd54b..de590bc51 100644 --- a/lib/transports/websocket.js +++ b/lib/transports/websocket.js @@ -15,7 +15,9 @@ if (typeof WebSocket !== 'undefined') { BrowserWebSocket = WebSocket; } else if (typeof self !== 'undefined') { BrowserWebSocket = self.WebSocket || self.MozWebSocket; -} else { +} + +if (typeof window === 'undefined') { try { NodeWebSocket = require('ws'); } catch (e) { }