XMPP4r with ejabberd

Hi,

I have been trying to get ejabberd to work with XMPP4R and have had
partial success.

ejabberd server page has…

The name of the current ejabberd node is ejabberd@localhost

I create a new instance…

myJID = JID.new(‘ejabberd@localhost/Bot’)
=> #<Jabber::JID:0x101631918 @resource=“Bot”, @node=“ejabberd”,
@domain=“localhost”>

and…

cl = Client.new(myJID)
=> #<Jabber::Client:0x101629d80 @ssl_capath=nil,
@tbcbmutex=#Mutex:0x101629b00,
@iqcbs=#<Jabber::CallbackList:0x101629c18 @list=[]>,
@keepalive_interval=60, @port=nil, @streamns=“jabber:client”,
@xmlcbs=#<Jabber::CallbackList:0x101629ce0 @list=[]>, @tls=false,
@exception_block=nil, @processing=0, @streamid=nil,
@messagecbs=#<Jabber::CallbackList:0x101629c68 @list=[]>,
@features_timeout=10, @host=nil, @wakeup_thread=nil, @fd=nil,
@allow_tls=“constant”, @features_sem=#<Jabber::Semaphore:0x101629a88
@lock=#Mutex:0x101629a38, @tickets=0,
@cond=#ConditionVariable:0x101629a10>, @last_send=Mon Feb 22 03:35:28
-0500 2010, @send_lock=#Mutex:0x101629b78, @parser_thread=nil,
@stanzacbs=#<Jabber::CallbackList:0x101629cb8 @list=[]>,
@ssl_verifycb=nil, @threadblocks=[],
@presencecbs=#<Jabber::CallbackList:0x101629bc8 @list=[]>, @status=1,
@jid=#<Jabber::JID:0x101631918 @resource=“Bot”, @node=“ejabberd”,
@domain=“localhost”>, @use_ssl=false>

connect it…

cl.connect
=> #<Jabber::Client:0x101629d80 @ssl_capath=nil,
@tbcbmutex=#Mutex:0x101629b00, @keepaliveThread=#<Thread:0x1015e2408
sleep>, @iqcbs=#<Jabber::CallbackList:0x101629c18 @list=[]>,
@keepalive_interval=60, @port=5222, @streamns=“jabber:client”,
@xmlcbs=#<Jabber::CallbackList:0x101629ce0 @list=[]>, @tls=false,
@exception_block=nil, @processing=0, @streamid=“3202133905”,
@messagecbs=#<Jabber::CallbackList:0x101629c68 @list=[]>,
@features_timeout=10, @host=“localhost”, @wakeup_thread=nil,
@fd=#TCPSocket:0x101618800, @allow_tls=“constant”,
@features_sem=#<Jabber::Semaphore:0x101629a88
@lock=#Mutex:0x101629a38, @tickets=0,
@cond=#ConditionVariable:0x101629a10>, @last_send=Mon Feb 22 03:35:46
-0500 2010, @send_lock=#Mutex:0x101629b78,
@socket=#TCPSocket:0x101618800, @parser_thread=#<Thread:0x101609e40
run>, @stanzacbs=#<Jabber::CallbackList:0x101629cb8 @list=[]>,
@stream_features={}, @stream_mechanisms=[], @ssl_verifycb=nil,
@threadblocks=[], @presencecbs=#<Jabber::CallbackList:0x101629bc8
@list=[]>, @status=2, @parser=#<Jabber::StreamParser:0x10160c528
@started=false, @current=nil, @listener=#<Jabber::Client:0x101629d80
…>, @stream=#TCPSocket:0x101618800>, @jid=#<Jabber::JID:0x101631918
@resource=“Bot”, @node=“ejabberd”, @domain=“localhost”>, @use_ssl=false>

authenticate…

cl.auth(“password”)
Jabber::ClientAuthenticationFailure: closed stream
from
/Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:118:in
`auth’
from (irb):7

and try and send a message, i get:

m = “kjm”
=> “kjm”

cl.send(m)
IOError: closed stream

I am not sure what is wrong, my ejabberd server screen has
this…

By default, the ejabberd Web Admin interface is enabled. You should be
able to connect to the admin interface and log in with the user
krokhale@krokhale and the password you defined during the installation.

I guess i am missing something small somewhere, i would really
appreciate your help for this!!

Thanks!!!