I'm using Faye and EventMachine to open a socket to another server. The server times out if it doesn't detect activity. How do I send the file (binary encoded) so the server doesn't time out?
Here's what I have:
media_path = "/path/to/media/file"
EM.run {
ws = Faye::WebSocket::Client.new(uri)
ws.on :open do |event|
puts "Opening socket"
ws.send(File.read(media_path))
end
ws.on :message do |event|
puts "Recieving message"
end
ws.on :close do |event|
ws = nil
EM.stop
end
}