Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (22 sloc) 0.534 kB
#!/usr/bin/env ruby
require 'rubygems'
require 'blather'
trap(:INT) { EM.stop }
trap(:TERM) { EM.stop }
EM.run do
Blather::Stream::Client.start(Class.new {
attr_accessor :jid
def post_init(stream, jid = nil)
@stream = stream
self.jid = jid
@stream.send_data Blather::Stanza::Presence::Status.new
puts "Stream started!"
end
def receive_data(stanza)
@stream.send_data stanza.reply!
end
def unbind
puts "Stream ended!"
end
}.new, 'echo@jabber.local', 'echo')
end
Jump to Line
Something went wrong with that request. Please try again.