require 'rubygems' require 'bundler/setup' require 'reel' app = Rack::Builder.new do map '/' do run lambda { |env| body = Reel::Stream.new do |body| # sending a payload to make sure browsers will render chunks as received body << "#{' '*1024}\n" ('A'..'Z').each do |l| body << "
#{l}
\n" sleep 0.5 end body << "\n" body.finish end [200, { 'Transfer-Encoding' => 'identity', 'Content-Type' => 'text/html' }, body] } end end.to_app Rack::Handler::Reel.run app, Port: 9292