Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="jquery-1.4.4.js"></script>
- <script src="jquery.stream-1.2.js"></script>
- <script>
- var println = function(string){
- $("#console").append(string+"<br />");
- }
- $(document).ready(function(){
- $.stream("stream.php",{
- open:function(){
- println("opened");
- },
- message:function(event){
- println(event.data);
- },
- error:function(){
- println("error");
- },
- close:function(){
- println("closed");
- }
- });
- });
- </script>
- </head>
- <body>
- <div id="console"></div>
- </body>
- </html>
- <?php
- header('Content-Encoding', 'chunked');
- header('Transfer-Encoding', 'chunked');
- header('Content-Type', 'text/html');
- header('Connection', 'keep-alive');
- ob_flush();
- flush();
- echo("23123454645645646;");
- $p = "";
- for ($i=0; $i < 1024; $i++) {
- $p .= " ";
- };
- echo($p.";");
- for ($i = 0; $i < 10000; $i++) {
- echo('6;string;');
- ob_flush();
- flush();
- sleep(2);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement