This commit is contained in:
2026-03-02 20:28:18 +05:30
parent 8d4cdcf601
commit f3bc9a27ae

View File

@@ -0,0 +1,26 @@
<?php
// stream.php
header("Content-Type: text/event-stream");
header("Cache-Control: no-cache");
header("Access-Control-Allow-Origin: *");
$siteId = file_get_contents("current_site.txt");
for ($i = 1; $i <= 5; $i++) {
echo "data: " . json_encode([
"type" => "update",
"message" => "Crawling page $i..."
]) . "\n\n";
ob_flush();
flush();
sleep(1);
}
echo "data: " . json_encode([
"type" => "complete",
"site_id" => trim($siteId)
]) . "\n\n";
ob_flush();
flush();