blob: b5fc455546a7a1693aba77355a14f436b7554b9c (
plain)
1
2
3
4
5
6
7
8
|
require 'net/http'
module InboxesHelper
def inboxes_faye_broadcast(channel, &block)
message = {:channel => channel, :data => capture(&block), :ext => {:auth_token => defined?(FAYE_TOKEN) ? FAYE_TOKEN : ""}}
uri = URI.parse("http://#{Inboxes::config.faye_host}:#{Inboxes::config.faye_port}/faye")
resource = Net::HTTP.post_form(uri, :message => message.to_json)
end
end
|