How publish from elixir app to phoenix channel

Hello!
How publish from elixir app to phoenix channel?

Maybe use <YourPhoenixAppName>.Endpoint.broadcast/3.

1 Like

Maybe I something didn’t understand.
I start my phoenix server got response that Running MyPhoenixWeb.Endpoint with Cowboy..., and try through my elixir app iex send message to channel MyPhoenixWeb.Endpoint.broadcast("room:lobby", "phx_join", {}) and get error module MyPhoenixWeb.Endpoint is not available.

1 Like

Try iex -S mix.

I used that, I thinked I write understandable, sorry.

Are you trying to send to a Phoenix app’s channels from a totally different BEAM instance? Like do you have two separate projects?

Different apps are started on different BEAM instances. If your phoenix endpoint and your other elixir app are on different instances, then you can use distributed erlang to communicate between them. If you can start your apps on the same instance, it would be easier though.

Yes @Nicd, I have 2 separate projects.
Thanks @idi527, I understood my mistake.