I have a php server sent events script as below:
<?php
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
$message = rand(5, 15);
echo "data: {$message}
";
ob_flush();
flush();
When I try to access the page script the browser downloads the file. Is there a way to prevent that? For security reasons, I do not want users to download the file and read its content.
Thanks.