From 96ef9eb5d3c823eb724f399c76077b0f2076b9a8 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Sat, 6 Oct 2012 17:29:16 +0200 Subject: [PATCH] check if readyState == 3 makes the responseText available in browsers we care about ... yes, it does --- play/log.html | 43 +++++++++++++++++++++++++++++++++++++++++++ play/log.ru | 18 ++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 play/log.html create mode 100644 play/log.ru diff --git a/play/log.html b/play/log.html new file mode 100644 index 00000000..cbdb792b --- /dev/null +++ b/play/log.html @@ -0,0 +1,43 @@ + + + + + + + + + + diff --git a/play/log.ru b/play/log.ru new file mode 100644 index 00000000..275e07c1 --- /dev/null +++ b/play/log.ru @@ -0,0 +1,18 @@ +require 'sinatra' + +set :server, :thin + +get '/' do + File.read('play/log.html') +end + +get '/log' do + chars = (97..122).to_a + stream do |out| + 1.upto(10000) do + out << chars[rand(chars.length)].chr + out << ' ' if rand(5) == 1 + sleep 0.001 + end + end +end