From 04b9ccca22ca64e5e5c53d075efb0e20ea6262d3 Mon Sep 17 00:00:00 2001
From: Sergey Lyubka <valenok@gmail.com>
Date: Wed, 18 Dec 2013 09:35:19 +0000
Subject: [PATCH] Testing server PINGs

---
 examples/websocket_html_root/ws.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/websocket_html_root/ws.html b/examples/websocket_html_root/ws.html
index 680b9bdc9..8f83a0bb7 100644
--- a/examples/websocket_html_root/ws.html
+++ b/examples/websocket_html_root/ws.html
@@ -24,9 +24,10 @@
       out('DISCONNECTED');
     };
     websocket.onmessage = function(ev) {
+      if (!ev.data) return; // No data, this is a PING message, ignore it
       out('<span style="color: blue;">RESPONSE: ' + ev.data + ' </span>');
       num_messages++;
-      if (num_messages > 3) {
+      if (num_messages > 100) {
         websocket.send('exit');
       }
     };
-- 
GitLab