feat: Add dynamic server URL and deployment guide
This commit is contained in:
parent
84d79ab642
commit
f93f2efd28
1 changed files with 9 additions and 3 deletions
|
|
@ -92,10 +92,16 @@ pub async fn handle_socket(mut socket: WebSocket, _addr: SocketAddr, state: AppS
|
|||
Some(Ok(Message::Text(text))) => {
|
||||
if let Ok(control) = serde_json::from_str::<ControlMsg>(&text) {
|
||||
match control {
|
||||
ControlMsg::UpdateStream { .. } => {
|
||||
// Broadcast to room
|
||||
ControlMsg::UpdateStream { stream_id, active, media_type, .. } => {
|
||||
// Broadcast to room with sender's user_id
|
||||
let update = ControlMsg::UpdateStream {
|
||||
user_id: uid,
|
||||
stream_id,
|
||||
active,
|
||||
media_type,
|
||||
};
|
||||
if let Some(room) = state.rooms.get(&rid) {
|
||||
let _ = room.tx.send(control);
|
||||
let _ = room.tx.send(update);
|
||||
}
|
||||
}
|
||||
ControlMsg::ChatMessage { message, display_name, .. } => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue