Remote server not found in XMPP

霸气de小男生 提交于 2020-01-06 06:57:34

问题


i send Packet to client

      <iq id="kGufc-4" to="tp@localhsot" from="admin@localhost" type="get"><query xmlns='http://localhost/protocol/disco#info'/></iq>

And received

   <iq id="kGufc-4" to="admin@localhost/testchat" from="tp@localhsot" type="error"><error code="404" type="CANCEL"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

what is problem???


回答1:


You have two problems with that stanza.

1) You've typod 'localhsot' instead of 'localhost'.

2) You're putting a 'from' on the stanza. Assuming you're a client sending this, it is better to not use a 'from', and let the server stamp it itself, as if you get the 'from' wrong, the server will start rejecting stanzas. In your case it's wrong as you're using the bare JID of the client, not the full JID.

Try resolving those first, and then seeing what happens.



来源:https://stackoverflow.com/questions/27353667/remote-server-not-found-in-xmpp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!