diff --git a/lib/websocket/driver/base.js b/lib/websocket/driver/base.js index e4a07e2..63459c7 100644 --- a/lib/websocket/driver/base.js +++ b/lib/websocket/driver/base.js @@ -96,6 +96,10 @@ var instance = { return false; }, + pong: function() { + return false; + }, + close: function(reason, code) { if (this.readyState !== 1) return false; this.readyState = 3; diff --git a/lib/websocket/driver/hybi.js b/lib/websocket/driver/hybi.js index eaab7bf..71faff5 100644 --- a/lib/websocket/driver/hybi.js +++ b/lib/websocket/driver/hybi.js @@ -169,6 +169,11 @@ var instance = { return this.frame(message, 'ping'); }, + pong: function(message) { + if (this.readyState > 1) return false; + return this.frame(message, 'pong'); + }, + close: function(reason, code) { reason = reason || ''; code = code || this.ERRORS.normal_closure;