kemal/samples/websocket_server.cr

12 lines
176 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
2016-03-19 13:38:54 +00:00
Kemal.run