Realtime-One-To-One-Chat
Realtime-One-To-One-Chat copied to clipboard
DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
Getting above error on page refres
h.
The message is being sent before the connection is established.
in init function change setTimeout to 1000ms
setTimeout(() => { var data = {'type' : 'login', 'name': userLogedIn}; conn.send(JSON.stringify(data)); },1000)
I want Notifications for other users in list if not a active chat. Also I want to store the messages in database and retrieve it from database if exist with load more functionality.
Do you have any idea how can I achieve this using web socket?