H
H
Higrok2020-12-20 16:29:41
JavaScript
Higrok, 2020-12-20 16:29:41

Why doesn't socket.io display messages?

Hello!

According to the documentation, I tried to write a chat on sockets, but I ran into a problem that a message sent from another tab is not displayed on the previous one, although it should, sort of. Why is that, and how to fix it?

Client side: https://pastebin.com/u3pPRqU0
Server side: https://pastebin.com/8WTC1PS1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2020-12-20
@Higrok

socket.broadcast.emit('add message', {message: msg});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question