Google Chrome and Streaming HTTP connections?

前端 未结 6 1508
一整个雨季
一整个雨季 2020-12-18 12:09

Google chrome doesn\'t behave the same as other browsers when encountering this nugget:



        
6条回答
  •  臣服心动
    2020-12-18 12:17

    ";
        }
        echo "";
        if($i == 0 ) {
            $padstr = str_pad("",2048," ");
            echo $padstr;
            echo "";
        }
        flush();
    
        sleep(5);
        $i = $i + 1;
    }
    ?>
    

    For fist time send at least 2048 bytes of data. then it will work fine. And make sure to keep script tag in a body tag. The strange thing is , in my case if I add 1024 bytes it worked. Hope this helps you

    The above program is working fine in google chrome.

提交回复
热议问题