up
This commit is contained in:
+5
-3
@@ -1081,9 +1081,11 @@
|
||||
console.log('Conectando a SSE para eventos en tiempo real...');
|
||||
|
||||
try {
|
||||
// EventSource no soporta withCredentials directamente
|
||||
// Usar token en URL como alternativa
|
||||
const sseUrl = 'api/sse_events.php?token=demo_token&t=' + Date.now();
|
||||
// Detectar URL base automáticamente (funciona en dev y producción)
|
||||
const baseUrl = window.location.origin; // http://localhost:8000 o https://tu-dominio.com
|
||||
const sseUrl = `${baseUrl}/api/sse_events.php?token=demo_token&t=${Date.now()}`;
|
||||
|
||||
console.log('SSE URL:', sseUrl);
|
||||
this.eventSource = new EventSource(sseUrl);
|
||||
|
||||
// Evento: conexión establecida
|
||||
|
||||
Reference in New Issue
Block a user