我一直这样做:
Step 1. <Stream>
Step 2. <Auth> (PLAIN)
Step 3. <Session>
Stuck here.
本教程未提及回拨:http://ceit.uq.edu.au/content/how-xmpp-works-step-step
但是,根据8.3。文档协议,它说要使用回拨:http://xmpp.org/rfcs/rfc3920.html
现在,这是我从服务器获得的完整回复:
<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1027203257' from='mysite.com' version='1.0' xml:lang='en'>
<stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='yy7di5kE0syuCXOQTXNBTclpJWo='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
<stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>
</stream:stream>
我已经在一些人的代码中看到过,在第2步之后,他们再次运行<stream>
,但在其他人中他们不会。这需要吗?
答案 0 :(得分:0)
服务器回拨用于s2s(服务器到服务器)连接。您不需要它用于c2s(客户端到服务器)连接。