loop control and external links

Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-11-27 22:03:01 +01:00
padre 686d418129
commit 10920e9f51
Se han modificado 5 ficheros con 180 adiciones y 11 borrados

Ver fichero

@@ -416,6 +416,28 @@ app.prepare().then(() => {
}
});
// Notificar loop detectado
socket.on('peer-loop-detected', (data) => {
try {
if (!socket.username || !data || !data.to) {
return;
}
const targetSocket = Array.from(io.sockets.sockets.values())
.find(s => s.username === data.to);
if (targetSocket) {
targetSocket.emit('peer-loop-detected', {
from: socket.username,
message: data.message
});
console.log(`⚠️ Loop detectado entre ${socket.username} y ${data.to}`);
}
} catch (error) {
console.error('Error al notificar loop:', error);
}
});
// Solicitar ver stream de usuario
socket.on('request-watch', (data) => {
try {