Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script src="jquery-1.4.4.js"></script>
  4. <script src="jquery.stream-1.2.js"></script>
  5. <script>
  6.  
  7. var println = function(string){
  8. $("#console").append(string+"<br />");
  9. }
  10.  
  11. $(document).ready(function(){
  12.  
  13.  
  14.  
  15. $.stream("stream.php",{
  16. open:function(){
  17. println("opened");
  18. },
  19. message:function(event){
  20. println(event.data);
  21. },
  22. error:function(){
  23. println("error");
  24. },
  25. close:function(){
  26. println("closed");
  27. }
  28. });
  29.  
  30.  
  31.  
  32. });
  33. </script>
  34. </head>
  35. <body>
  36.  
  37.  
  38. <div id="console"></div>
  39.  
  40. </body>
  41. </html>
  42.  
  43. <?php
  44.  
  45.  
  46. header('Content-Encoding', 'chunked');
  47. header('Transfer-Encoding', 'chunked');
  48. header('Content-Type', 'text/html');
  49. header('Connection', 'keep-alive');
  50.  
  51. ob_flush();
  52. flush();
  53.  
  54. echo("23123454645645646;");
  55.  
  56.  
  57. $p = "";
  58. for ($i=0; $i < 1024; $i++) {
  59. $p .= " ";
  60. };
  61. echo($p.";");
  62.  
  63.  
  64.  
  65. for ($i = 0; $i < 10000; $i++) {
  66. echo('6;string;');
  67. ob_flush();
  68. flush();
  69. sleep(2);
  70. }
  71.  
  72.  
  73.  
  74.  
  75. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement