Skip to content

Instantly share code, notes, and snippets.

@ktkaushik
Created November 16, 2012 12:12
Show Gist options
  • Select an option

  • Save ktkaushik/4086826 to your computer and use it in GitHub Desktop.

Select an option

Save ktkaushik/4086826 to your computer and use it in GitHub Desktop.
broadcast message to faye channel using net/http
def broadcast_message
uri = URI.parse('http://ws.192.168.2.3.xip.io:9292/faye')
message = {:channel => '/devices/location/coordinates/b8de8b239eafb3f7', :data => "this is a test message"}
Net::HTTP.post_form(uri, :message => message.to_json)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment