Skip to content

Instantly share code, notes, and snippets.

@ShinyChang
Created November 13, 2015 03:30
Show Gist options
  • Save ShinyChang/96c836014e9de78cf518 to your computer and use it in GitHub Desktop.
Save ShinyChang/96c836014e9de78cf518 to your computer and use it in GitHub Desktop.
<?php
header('Access-Control-Allow-Origin: *');
header('Cache-Control: private');
header('Pragma: no-cache');
Header('Connection: Keep-Alive');
Header('Proxy-Connection: Keep-Alive');
Header('Content-Type: application/json;charset=UTF-8');
// generate 2k garbage data
foreach (range(0, 2048) as $key => $value) {
echo " ";
}
while (true) {
echo json_encode(array(
'status' => true,
'message' => 'Hello World!!'
));
ob_flush();
flush();
sleep(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment