Add websocket_server sample
This commit is contained in:
parent
c005bae101
commit
5fa399de2c
1 changed files with 9 additions and 0 deletions
9
samples/websocket_server.cr
Normal file
9
samples/websocket_server.cr
Normal file
|
@ -0,0 +1,9 @@
|
|||
require "kemal"
|
||||
|
||||
ws "/" do |socket|
|
||||
socket.send "Hello from Kemal!"
|
||||
|
||||
socket.on_message do |message|
|
||||
socket.send "Echo back from server #{message}"
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue