I don’t believe I am doing anything wrong here, but would appreciate some guidance if I am.
Trying to stream some binary data down a websocket but getting some weird results:
socket = HTTP::WebSocket.new("demos.kaazing.com", "/echo")
socket.on_binary do |data|
# Data echo'd back is 0, 0, 0, 0 ...
me = data
other = String.new(data)
socket.close
end
# Send the text "testing..." to the far end as binary
socket.stream { |io| io.write "testing...".to_slice }
socket.run
While running that in crystal play
i monitored traffic in wireshark and it looks like it’s sending 0’s instead of the data written to the stream
Am I doing something wrong here or should I open an issue?