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
This commit is contained in:
parent
3a952c9156
commit
bc631bd9c0
@ -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!');
|
||||
conn.onopen = function(e) { conn.send('Hello Me!'); };
|
||||
```
|
Loading…
Reference in New Issue
Block a user