diff --git a/lib/WebSocketConnection.js b/lib/WebSocketConnection.js index 219de631..6b3e274a 100644 --- a/lib/WebSocketConnection.js +++ b/lib/WebSocketConnection.js @@ -262,7 +262,9 @@ WebSocketConnection.prototype.handleGracePeriodTimer = function() { WebSocketConnection.prototype.handleSocketData = function(data) { this._debug('handleSocketData'); // Reset the keepalive timer when receiving data of any kind. - this.setKeepaliveTimer(); + if (!this.config.keepaliveForce) { + this.setKeepaliveTimer(); + } // Add received data to our bufferList, which efficiently holds received // data chunks in a linked list of Buffer objects.