Skip to content

Instantly share code, notes, and snippets.

@andriytyurnikov
Forked from josevalim/config.ru
Last active December 14, 2015 10:49
Show Gist options
  • Save andriytyurnikov/5074502 to your computer and use it in GitHub Desktop.
Save andriytyurnikov/5074502 to your computer and use it in GitHub Desktop.
# rackup -s thin
require 'thin'
run proc { |env|
body = Enumerator.new do |socket|
5.times do
socket << "Hello"
puts "Hello"
sleep 1
end
end
[200, { 'Content-Type' => 'text/html', "Content-Encoding" => "chunked" }, body]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment