Skip to content

Commit

Permalink
add websocket to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Oct 17, 2024
1 parent 57115b9 commit d8d0ddd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ get "/" do |env|
"Hi, %s! You sent a request that was successfully verified with HMAC auth" % env.kemal_authorized_client?
end
# The `hmac_auth` method also protects websocket routes
ws "/websocket" do |socket|
socket.send "HMAC protected websocket route, hooray!"
socket.close
end
Kemal.run
# $ crystal run hmac_server.cr
Expand Down

0 comments on commit d8d0ddd

Please sign in to comment.