Skip to content

Instantly share code, notes, and snippets.

@toretore
Created September 15, 2014 16:37
Show Gist options
  • Save toretore/f4da3c1ef95b85a3ceec to your computer and use it in GitHub Desktop.
Save toretore/f4da3c1ef95b85a3ceec to your computer and use it in GitHub Desktop.
class Server
def call(env)
req = Request.new('http://www.example.com/')
headers = nil
req.on_headers{|h| headers = h }
req.start
sleep 0.1 until headers
[200, headers, Enumerator.new(streamer, :on_body)]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment