ejabberd

ejabberd中的http反向推送

喜夏-厌秋 提交于 2019-12-06 01:29:31
http的反向推送通常使用"长轮询"或"长连接"的方式。 所谓"长轮询"是指客户端发送请求给服务器,服务器发现没有数据需要发送给客户端于是hold住不及时返回,等有数据需要发送给客户端时,进行回复,然后关闭连接,客户端收到回复后再发送新的http请求,以便服务器能有对应的请求用于消息的反向推送。 而"长连接"是在长轮询的基础上增加"keep-alive"属性,服务器收到请求后不直接回复,等有数据需要发送给客户端时再进行response,但是并不关闭连接,这样客户端收到服务器的response后在同一连接上再次发送http请求。 在ejabberd的实现中,采用了bosh技术来完成对应的工作,具体定义可参考: 英文: http://xmpp.org/extensions/xep-0124.html 中文: http://wiki.jabbercn.org/XEP-0124 大概实现原理:ejabberd收到一个客户端http请求后会为该客户端最终创建三个进程:ejabberd_http, ejabberd_http_bind, ejabberd_c2s。 ejabberd_http进程不断的从对应的socket上收客户端的请求,并转发交给对应的ejabberd_http_bind进程进行处理,然后同步等待处理结果,并将结果返回给客户端。 init() -> ... receive

How to register user on ejabbered using php code

為{幸葍}努か 提交于 2019-12-05 20:56:21
I found a code from stack over flow to execute the register command in ejabberd xmpp chat server using php. (Create ejabberd user from PHP) But when i execute the file i got error: "sudo: unknown user: ejabberd" "sudo: unable to initialize policy plugin" I am runing this code on my ubuntu(14.04 LTS 64-bit) machine The php code i am using as follows: <?php $username = 'tester'; $password = 'testerspassword'; $node = 'myserver.com'; exec('sudo -u ejabberd /usr/sbin/ejabberdctl register '.$username.' '.$node.' '.$password.' 2>&1',$output,$status); if($output == 0) { // Success! } else { //

Unable to login to ejabberd server using XMPP client in Android

核能气质少年 提交于 2019-12-05 17:26:15
I am trying to connect & login to ejabberd server using a XMPP client in Android. The XMPP client connects to the server but doesn't logs in. I am getting Exception message as No response from the server . I don't know where is the problem. Following is the code: XMPP Client.java package org.apache.android.xmpp; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import org.jivesoftware

Session resume problem with Strophe attach and Ejabberd

前提是你 提交于 2019-12-05 14:11:22
I'm having a lot of difficulty getting strophe's 'attach()' function working. I am working on a social network where users will be surfing pages and at the same time keep their chat connection on. I don't want to reconnect/reauthorize on every page so as per this link, http://groups.google.com/group/strophe/browse_thread/thread/430da5e788278f3a/93c48c88164f382f?show_docid=93c48c88164f382f&fwc=1 , i am storing the SID and RID into a cookie onunload. On the next page when i try to use the new SID and RID (after incrementing it by 1) my session is already destroyed. Ejabberd reports "Error on

smack connect to xmpp server with previous stream id

ぐ巨炮叔叔 提交于 2019-12-05 09:54:24
I'm building a chat application using xmpp over Ejabbered for server and smack for android client I've established connecting , login , send and receiving messages ,then I've faced a problem with user network disconnecting and reconnecting , which has been solved by Reconnecting Manger in smack and xmpp-0198, however there is a case where i need to create a new connection in smack but use the previous session (stream) to get all the messages stored in that session (they don't get stored to offline messages) ,and if i create a new connection with new stream id , user messages get lost . so is

How to handle MUC chat messages- messages duplicating

强颜欢笑 提交于 2019-12-05 07:08:37
问题 I have implemented one to one chat using XMPP framework It has extensive support in one to one chat. Message archiving and fetching is way simple. But i see, very difficulty in handling a group chat message saving and displaying. The sorting and predicates are failing. duplicate messages are shown. This is how i join a room before i fetch my already saved message) XMPPRoomCoreDataStorage *coreDataRoomStorage=[self appDelegate].xmppRoomCoreDataStorage; XMPPRoom *room=[[XMPPRoom alloc

how to create persistent muc room in smack 4.1 beta2

为君一笑 提交于 2019-12-05 05:29:14
问题 migrated from asmack to smack 4.1 beta2. The muc rooms created are no longer persistent. MultiUserChatManager mucm=MultiUserChatManager.getInstanceFor(connection); muc=mucm.getMultiUserChat(groupid+"@conference.localhost"); DiscussionHistory histroy=new DiscussionHistory(); histroy.setMaxStanzas(10); muc.createOrJoin(username,null,histroy,SmackConfiguration.getDefaultPacketReplyTimeout()); muc.nextMessage(); when created with gajim, the rooms are persistent. EDIT : Here is code we used

ejabberd: Error running Post Install Script

这一生的挚爱 提交于 2019-12-05 05:27:13
I'm trying to install ejabberd on my pc but I keep getting this error: Error running Post Install Script The installation may not have completed correctly ejabberd 15.07 has been released and is likely to have fix your issues with installer. You can download upgrade on ejabberd Download page . 来源: https://stackoverflow.com/questions/31269714/ejabberd-error-running-post-install-script

How to develop custom functions on top of Ejabberd?

て烟熏妆下的殇ゞ 提交于 2019-12-05 03:27:09
I'm developing a real time chat app. After searching around for a while, I found Ejabberd and Erlang is a good option. The question is the Ejabberd is not providing all the functions I need. I need some custom features such as location based matching and anonymous login. So how to development custom functions on top of Ejabberd? write modules for it? or develop another standalone server app (web or other kind of server app) to interact with it? update: another concern is the way we add custom functions/features should be scalable. You can write your custom modules which hook up to events in

difference between XMPP servername and XMPP servicename?

不羁岁月 提交于 2019-12-04 21:44:43
问题 In Smack API, there is a configuration class for connection, described at this page ConnectionConfiguration I am confused about the distinction between service name and server name. Suppose I have a computer named "mybox.mydomain.com", and I have ejabberd on it with a configured host called "myhost" (using the line {hosts, ["myhost"]}. in ejabbed.cfg), what is the host name, server name and service name in this case? 回答1: myhost: service name (or XMPP domain) mybox.mydomain.com: hostname and