I have the following simple code which I execute with PHP’s built-in webserver (php -S 0.0.0.0:80):
<?php
header("Cache-Control: no-cache");
header("Content-Type: text/event-stream");
while (true) {
echo 'data: test', "\n\n";
while (ob_get_level() > 0)
ob_end_flush();
flush();
if (connection_aborted())
break;
sleep(5);
}
When viewing the Public Device URL there is zero output. If however, I shut off the Public URL and use (ngrok http 80) to create an introspecting tunnel, the script functions as expected; it produces output every 5 seconds. Why is there no output when using the Public Device URL?