I have a Faye server running with ruby, and now, I need to send notifications to a client in Scala, but scala can’t handle Bayeux, only WebSockets.
Is there a way to change my connection type from Bayeux to using websockets?
Some conf. files I have
faye.ru
require 'faye'
Faye::WebSocket.load_adapter('thin')
bayeux = Faye::RackAdapter.new(:mount => '/faye', :timeout => 25)
run bayeux
sending notifications
def broadcast(channel, data)
message = {:channel => channel, :data => data, :ext => {:auth_token => FAYE_TOKEN}}
uri = URI.parse("http://192.168.0.92:9292/faye")
Net::HTTP.post_form(uri, :message => message.to_json)
end
We migrate our scala app to ruby. Much better now 🙂