2 # Example application that echoes read data back to the HTTP client.
3 # This emulates the old echo protocol people used to run.
5 # An example of using this in a client would be to run:
6 # curl -NT- http://host:port/
8 # Then type random stuff in your terminal to watch it get echoed back!
10 Unicorn::HttpRequest::DEFAULTS["unicorn.stream_input"] = true
17 while buf = @input.read(4096)
30 [ 200, { 'Content-Type' => 'application/octet-stream' },
31 EchoBody.new(env['rack.input']) ]