Reputation: 8846
I would like to consume a websocket server connection using Crystal as a client. Does the Crystal standard library provide a WebSocket client library?
Upvotes: 3
Views: 1065
Reputation: 2999
Starting with Crystal 0.8.0 you should be able to:
socket = HTTP::WebSocket.open("example.com", "/connect")
socket.send "action"
message = socket.receive
See https://github.com/manastech/crystal/pull/1369 for more details.
Upvotes: 3