diff --git a/lib/ret/hub.ex b/lib/ret/hub.ex index f0ae72bbf..aa21402db 100644 --- a/lib/ret/hub.ex +++ b/lib/ret/hub.ex @@ -656,6 +656,12 @@ defmodule Ret.Hub do if host && host != hub.host do hub |> changeset_for_new_host(host) |> Repo.update!() + + RetWeb.Endpoint.broadcast("hub:" <> hub.hub_sid, "host_changed", %{ + host: host, + port: Hub.janus_port(), + turn: Hub.generate_turn_info() + }) else hub end diff --git a/lib/ret_web/channels/hub_channel.ex b/lib/ret_web/channels/hub_channel.ex index 951741b39..389526073 100644 --- a/lib/ret_web/channels/hub_channel.ex +++ b/lib/ret_web/channels/hub_channel.ex @@ -834,6 +834,11 @@ defmodule RetWeb.HubChannel do {:noreply, socket} end + def handle_out("host_changed" = event, payload, socket) do + push(socket, event, payload) + {:noreply, socket} + end + defp maybe_push_naf( socket, event,