up
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
// Test simple de SSE
|
||||
header('Content-Type: text/event-stream');
|
||||
header('Cache-Control: no-cache');
|
||||
header('Connection: keep-alive');
|
||||
header('X-Accel-Buffering: no');
|
||||
|
||||
if (ob_get_level()) ob_end_clean();
|
||||
@ini_set('output_buffering', 'off');
|
||||
@ini_set('zlib.output_compression', 'off');
|
||||
|
||||
echo "event: connected\n";
|
||||
echo "data: " . json_encode(['test' => true, 'timestamp' => time()]) . "\n\n";
|
||||
|
||||
if (ob_get_level()) ob_flush();
|
||||
flush();
|
||||
|
||||
echo ": heartbeat\n\n";
|
||||
flush();
|
||||
|
||||
// Log para debug
|
||||
error_log('SSE Test: enviado evento connected');
|
||||
Reference in New Issue
Block a user