I
I
IvanN7772017-02-09 14:48:38
Erlang
IvanN777, 2017-02-09 14:48:38

I'm writing a chat in erlang cowboy, the websocket connection goes on, but it's like every user is in his own channel?

I am writing a chat in erlang cowboy, the websocket connection goes on, but as if every user is in their own channel.
Here is the source code of a simple chat https://bitbucket.org/YonRat/erlangg
Here we are interested in the handler in src disrupt_handler.erl
And the route route disrupt_app.erl
I don't know though.
The chat just
starts ./rebar compile generate
rm -rf rel/disrupt
./rel/disrupt/bin/disrupt console It starts
on port 8080.
What is the error. when I send messages, they come to the handler, you can even change them and return back to the chat, but if 2 users connect and connect to the same address ws://localhost:8080/connect
The connection occurs, but in isolation from each other, although the address is the same.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2017-02-09
@IvanN777

That's right, websockets are just a tunnel from you to the server. You also need to organize a chat room and send messages from users there. And the chat room will forward messages to others.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question