diff --git a/examples/websocket_html_root/ws.html b/examples/websocket_html_root/ws.html
index 680b9bdc959087fc46d117e52a5b3da8ece5413f..8f83a0bb778f3be5029bfdc05208ad1d550f3001 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');
       }
     };