From bc631bd9c0f6ebfba751aaeaa23cb2a6706f446c Mon Sep 17 00:00:00 2001 From: Gyula Madarasz Date: Tue, 28 Mar 2017 14:12:54 +0100 Subject: [PATCH] Update README.md example code in readme failed in browser client by message: "Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state" so wait for connection state is opened --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5cc5976..92aa73c 100644 --- a/README.md +++ b/README.md @@ -86,5 +86,5 @@ class MyChat implements MessageComponentInterface { // Then some JavaScript in the browser: var conn = new WebSocket('ws://localhost:8080/echo'); conn.onmessage = function(e) { console.log(e.data); }; - conn.send('Hello Me!'); -``` \ No newline at end of file + conn.onopen = function(e) { conn.send('Hello Me!'); }; +```