Sha256: 3a050446049756a1c2a26a663eef91db07ee06b6d3cc824f25802026109a5905

Contents?: true

Size: 389 Bytes

Versions: 4

Compression:

Stored size: 389 Bytes

Contents

require 'async/websocket/server'

class Upgrade
	def initialize(app)
		@app = app
	end
	
	def call(env)
		Async::WebSocket::Server.open(env) do |server|
			read, write = IO.pipe
			
			Process.spawn("ls -lah", :out => write)
			write.close
			
			read.each_line do |line|
				server.driver.text(line)
			end
		end or @app.call(env)
	end
end

use Upgrade

run lambda {|env| [404, {}, []]}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
async-websocket-0.5.0 spec/async/websocket/connection_spec.ru
async-websocket-0.4.1 spec/async/websocket/connection_spec.ru
async-websocket-0.4.0 spec/async/websocket/connection_spec.ru
async-websocket-0.3.0 spec/async/websocket/connection_spec.ru