我正在尝试使用xmpp4r测试向一个jid帐户发送消息:
require 'xmpp4r'
include Jabber
jid = JID::new('alice@wonderland.lit')
password = 'secr3t'
cl = Client::new(jid)
cl.connect('166.78.7.179')
cl.auth(password)
cl.send(Presence.new)
to = 'arthur@wonderland.lit'
subject = 'XMPP4R test'
body = 'Hi, this is a XMPP4R test'
m = Message::new( to, body ).set_type(:chat).set_id('1').set_subject(subject)
cl.send m但我总是得到以下例外:
/home/subout/.rvm/gems/ruby-1.9.3-p374@subout/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:118:in `rescue in auth': closed stream (Jabber::ClientAuthenticationFailure)
from /home/subout/.rvm/gems/ruby-1.9.3-p374@subout/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:108:in `auth'
from send_message2.rb:9:in `<main>'发布于 2013-04-02 12:06:19
Jabber::debug = true和post输出之前添加cl.connect设置好吗?xmpp4r而不是现代的继承者Blatherhttps://stackoverflow.com/questions/15759045
复制相似问题