diff --git a/lib/transports/websocket.js b/lib/transports/websocket.js index 338013c3..36a60366 100644 --- a/lib/transports/websocket.js +++ b/lib/transports/websocket.js @@ -89,7 +89,7 @@ WS.prototype.write = function(packets){ this.socket.send(parser.encodePayload(packets)); // check periodically if we're done sending this.bufferedAmountId = this.setInterval(function() { - if (socket.bufferedAmount == 0) { + if ('bufferedAmount' in this.socket && this.socket.bufferedAmount == 0) { clearInterval(self.bufferedAmountId); this.writable = true; this.emit('drain');