简体   繁体   English

发布XMPP框架(iOS)和EJabberd服务器

[英]Issues XMPP framework (iOS) and EJabberd server

I want to create a chat application that uses Ejabberd as the server. 我想创建一个使用Ejabberd作为服务器的聊天应用程序。 I setup the ejabberd on my laptop Ubuntu 12.04 and port forward to my public ip. 我在我的笔记本电脑Ubuntu 12.04上安装了ejabberd并将其转发到我的公共IP。 I try to use Pidgin(Ubuntu), Adium(MacOS), IM+(Andriod, IOS). 我尝试使用Pidgin(Ubuntu),Adium(MacOS),IM +(Andriod,IOS)。 All of them can connect and chat with each other. 他们都可以相互联系和聊天。

However, when I follow the tutorial here http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-xmpp-integration/ to build my own chat app. 但是,当我按照http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-xmpp-integration/中的教程来构建我自己的聊天应用程序时。 I got a number of issues that cant let me chat with other accounts. 我遇到了一些无法让我与其他帐户聊天的问题。

Here are the messages sent and received: 以下是发送和接收的消息:

2012-07-19 11:59:59:749 XMPPStream[49107:403] RosterController: awakeFromNib
2012-07-19 11:59:59:973 XMPPStream[49107:403] AppDelegate: applicationDidFinishLaunching:
2012-07-19 12:00:06:460 XMPPStream[49107:4603] SEND: <?xml version='1.0'?>
2012-07-19 12:00:06:460 XMPPStream[49107:4603] SEND: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='xxx.xxx.xxx.xxx'>
2012-07-19 12:00:06:464 XMPPStream[49107:4603] RECV: <stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" id="1582664547" from="xxx.xxx.xxx.xxx" version="1.0" stream:lang="en"/>
2012-07-19 12:00:06:465 XMPPStream[49107:4603] RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><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="wwrSvLFOLzC92POh074kJuEqYxE="/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>
2012-07-19 12:00:06:465 XMPPStream[49107:403] RosterController: xmppStreamDidConnect:
2012-07-19 12:00:06:466 XMPPStream[49107:403] SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5"/>
2012-07-19 12:00:06:468 XMPPStream[49107:3e0b] RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">bm9uY2U9IjIxNTYzMTM4ODEiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
2012-07-19 12:00:06:468 XMPPStream[49107:3e0b] SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Imt3ZWluZXIxIixyZWFsbT0iMjAzLjIwNS4xMC4xMjciLG5vbmNlPSIyMTU2MzEzODgxIixjbm9uY2U9Ijg1RUU5MTczLTQ0RTEtNDNDMS1CNzFBLTY3OEE5NTQ2MjU1MiIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC8yMDMuMjA1LjEwLjEyNyIscmVzcG9uc2U9NzMwZWZjNzUxOWIwNzNiNDEzMGU0NjFjMmVmMjliNmIsY2hhcnNldD11dGYtOA==</response>
2012-07-19 12:00:06:502 XMPPStream[49107:4603] RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD00YzRjMDk4ZGJhYjk2NmNiMTg3MzVhOTMyYTZhMDkxYw==</challenge>
2012-07-19 12:00:06:502 XMPPStream[49107:4603] SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
2012-07-19 12:00:06:854 XMPPStream[49107:4603] RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
2012-07-19 12:00:06:854 XMPPStream[49107:4603] SEND: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='xxx.xxx.xxx.xxx'>

Here are what I observed: 以下是我观察到的:

  • When I turn off the ejabberd server, the client app stops working. 当我关闭ejabberd服务器时,客户端应用程序停止工作。 This mean it tried to connect to the server. 这意味着它试图连接到服务器。
  • On Android, Ubuntu, and MacOS, everytime I login it ask for accepting a certificate. 在Android,Ubuntu和MacOS上,每次登录时都要求接受证书。 But I dont see it on MY iOs app. 但我没有在我的iOs app上看到它。
  • It seems that after success, it renegotiates and doesnt receive any response. 似乎在成功之后,它重新谈判并且没有得到任何回应。
  • On the web admin of ejabberd, I dont see any online user. 在ejabberd的网络管理员,我没有看到任何在线用户。 However, I see request is coming in the log. 但是,我看到请求即将出现在日志中。 What documents and steps should I follow to debug XMPP application on iOS? 我应该遵循哪些文档和步骤来调试iOS上的XMPP应用程序?

I'm using XCode 4.3.2 iOS 5.1 Ejabberd 2.1.11 on Ubuntu (Linux 32 bits). 我在Ubuntu(Linux 32位)上使用XCode 4.3.2 iOS 5.1 Ejabberd 2.1.11。 I tried to debug and google for 2 days but no clue 我尝试调试和谷歌2天,但没有任何线索

I dig into the framework and suggested a fix here. 我深入研究框架,并在此提出修复建议。 https://github.com/robbiehanson/XMPPFramework/issues/81 https://github.com/robbiehanson/XMPPFramework/issues/81

It is working now. 它现在正在运作。 Hope it saves everyone else's time. 希望它能节省其他人的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM