I am learning about Phoenix Channel and have question on behavior of broadcast which not as I expected.
Environment: Windows 10, Phoenix 1.4.17, Erlang 22, Elixir 1.12
firstname.lastname@example.org, listening on port 4000
email@example.com, listening on port 4001
client1 - wscat connects to firstname.lastname@example.org on port 4000, then subscribe to “ping” topic.
client2 - wscat connects to email@example.com on port 4001, then subscribe to “ping” topic.
And here is my doubt, when I broadcast on firstname.lastname@example.org, only client1 receives the message.
When I broadcast on email@example.com, only client2 receives the message.
I need help on what is exactly the correct behavior?
Have you connected the two nodes? They need to be connected before they can chat with each other.
That’s all it needs. Thanks.
How to make them connected automatically on startup?
You can look at the libcluster library as one way to do that
Many thanks for giving the hint.