Update dependencies
[sunshowers.git] / t / echo.ru
blob6c1131cc9fcecd3e8a0e142fcac3eb0c6c905a72
1 #\-E deployment
3 # This is designed to run against:
4 #   http://pywebsocket.googlecode.com/svn/trunk/src/example/echo_client@139
6 require 'lmgtwty'
7 use Rack::ContentLength
8 use Rack::ContentType
9 run lambda { |env|
10   req = Lmgtwty::Request.new(env)
11   if req.ws?
12     req.ws_handshake!
13     ws_io = req.ws_io
14     ws_io.each do |record|
15       ws_io.write(record)
16       break if record == "Goodbye"
17     end
18     req.ws_quit! # Rainbows! should handle this quietly
19   end
20   [404, {}, []]