diff --git a/lib/gxg/gxg_events.rb b/lib/gxg/gxg_events.rb index b2db732..11178b5 100644 --- a/lib/gxg/gxg_events.rb +++ b/lib/gxg/gxg_events.rb @@ -105,7 +105,12 @@ module GxG if ::GxG::valud_uuid?(destination.to_s) channel = self.fetch_channel(destination.to_s.to_sym) if channel - channel.write(the_message) + if channel.socket + # Send format: channel.socket.send({ :payload => the_message.export.to_s.encrypt(channel.secret).encode64 }.to_json.encode64, :text) + channel.socket.send({ :payload => the_message.export.to_s.encrypt(channel.secret).encode64 }.to_json.encode64, :text) + else + channel.write(the_message) + end result = true end end