Sha256: efab91752a17381374c375c7b0c951243eb864e1ebe826a1a4cd4e285ec71879

Contents?: true

Size: 381 Bytes

Versions: 1

Compression:

Stored size: 381 Bytes

Contents

prepend Actions

require 'async/websocket/server'

$connections = []

on 'connect' do |request|
	respond? Async::WebSocket::Server::Rack.open(request.env) do |connection|
		$connections << connection
		
		while message = connection.read
			$connections.each do |connection|
				puts "Server sending message: #{message.inspect}"
				connection.write(message)
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
async-websocket-0.10.0 examples/utopia/pages/server/controller.rb