shard-kemal/samples/websocket_server.cr

10 lines
165 B
Crystal
Raw Normal View History

2015-12-16 18:36:41 +00:00
require "kemal"
ws "/" do |socket|
socket.send "Hello from Kemal!"
socket.on_message do |message|
socket.send "Echo back from server #{message}"
end
end