Skip to content

Instantly share code, notes, and snippets.

@yankov
Created May 23, 2012 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yankov/2773099 to your computer and use it in GitHub Desktop.
Save yankov/2773099 to your computer and use it in GitHub Desktop.
# do gem install web-socket-ruby first
require 'web_socket'
require 'json'
client = WebSocket.new("ws://localhost:8080/eventbus/websocket")
message = {:name => "tim", :age => 29}
envelope = {:type => "send",
:address => "some-address",
:body => message }
client.send(envelope.to_json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment