strophe

XMPP: retrieving BOSH Session ID and RID

烂漫一生 提交于 2019-12-05 18:27:26
Please tell me how to retrieve the SID and JID. I am using Strophe JS. <body rid='489923353' xmlns='http://jabber.org/protocol/httpbind' sid='ab7f5957' to='127.0.0.1' xml:lang='en' xmpp:restart='true' xmlns:xmpp='urn:xmpp:xbosh'/> var conn = new Strophe.Connection(bosh_service); However, conn.sid or conn.rid is not returning the same numbers. After this and that, I think I found the answer! else if(status === Strophe.Status.CONNECTED){ //get roster var iq = $iq({type: 'get'}).c('query', {xmlns: 'jabber:iq:roster'}); Chat.connection.sendIQ(iq, Chat.on_roster); //on chat Chat.connection

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

Strophe character encoding issue

吃可爱长大的小学妹 提交于 2019-12-05 05:29:37
I am working on an XMPP client and having an issue with messages being sent/received by Strophe (javascript version). The issue is messages that contain "special" characters. For instance, if I send: I'm here. An external client (i.e. iChat) will display I&ampapos;m here. A strophe client doesn't display anything at all. If I send that same message from iChat to the strophe client, it displays properly. Here is the most basic sample code I could come up with: <html> <head> <script type='text/javascript' src='strophe.min.js'></script> <script type='text/javascript'> function onConnect(status) {

Openfire server, multiple connection, route.all-resources doesn't work

久未见 提交于 2019-12-04 17:36:25
We use http-bind with BOSH and Openfire (3.8.2) as backend and Strophe library (JS) on frontend for our chat application. Every user gets a specified unique resource by connection. That means, that a user can be logged in different devices/browsers at once (multiple connection, e.g user@example.com/resource1 , user@example.com/resource2 etc.). Ideally, we want messages to be sent to all connected resources. We set route.all-resources setting="true" and the connection priority is equal for all user resources, but behavior hasn't changed at all (chat messages received only last connected user

Online and Offline users using strophe.js in real time

社会主义新天地 提交于 2019-12-04 13:13:09
I am using strophe.js javascript client library for connecting to xmpp server( openfire ) using below code. var BOSH_SERVICE = 'http://127.0.0.1:7070/http-bind/'; connection = new Strophe.Connection(BOSH_SERVICE); connection.connect("jid", "password", onConnect); and callback function(onConnect) as below : function onConnect(status) { if (status == Strophe.Status.CONNECTING) { log('Strophe is connecting.'); } else if (status == Strophe.Status.CONNFAIL) { log('Strophe failed to connect.'); $('#connect').get(0).value = 'connect'; } else if (status == Strophe.Status.DISCONNECTING) { log('Strophe

Handling presence in Strophe.js-based chat application

早过忘川 提交于 2019-12-04 11:00:45
问题 Is there any existing solution which provides the presence handling for chat app based on Strophe.js? I have simple chat application based on Strophe.js. I'd like to show only the users who are online and dynamicaly alter the list. I was wondering whether there is any existing solution (possibly Strophe plugin) which handles this. If there's no such thing, what's the best/simplest way to implement it? 回答1: By using Strophe, you can just send an IQ to your server that asks for your roster list

XMPP: AngularJs + Strophe.js

主宰稳场 提交于 2019-12-04 09:42:26
问题 I have a basic XMPP client working on strophe.js. On login I create handlers such as connect = new Strophe.Connection('http://localhost/http-bind'); ... ... connect.addHandler(on_message, null, "message", "chat"); connect.addHandler(on_presence, null, "presence"); ... ... and then I "listen" to those function on_presence(presence) { // handling presence } function on_message(presence) { // handling presence } So I am trying to "convert" it into AngularJS. The first part is pretty straight

XMPP multiple sessions of the same user issue

孤者浪人 提交于 2019-12-03 12:03:21
问题 I've implemented a chrome extension which allow to use XMPP chat over BOSH connection with punjab server running on a remote server. It is implemented using javascript Strophe library. The issue I'm running into is when I have multiple sessions of the same user (e.g. two different browsers on the same machine) I can't receive and log to the second chat window the message I sent from first chat window. There needs to be some mechanism which allows that. Can I somehow receive messages I have

XMPP multiple sessions of the same user issue

我的梦境 提交于 2019-12-03 02:25:24
I've implemented a chrome extension which allow to use XMPP chat over BOSH connection with punjab server running on a remote server. It is implemented using javascript Strophe library. The issue I'm running into is when I have multiple sessions of the same user (e.g. two different browsers on the same machine) I can't receive and log to the second chat window the message I sent from first chat window. There needs to be some mechanism which allows that. Can I somehow receive messages I have sent to some other user? The issue can also be reproduced on 2 or more different machines so this needs

Realtime server push with Socket IO (or Strophe.js), XMPP and Django

泪湿孤枕 提交于 2019-12-02 23:41:44
I have a couple of Android and iOS native mobile application that I wrote which connect directly to an XMPP server that I host. They push and pull realtime data through XMPP. I also use some of the XMPP XEP extensions . For other operations, I have a django application running on the same server which all the mobile applications consume through an HTTP REST interface. I use Celery and Redis for the django side to do some operations asynchronously (like doing heavy batched writes to my db). This all works fine and dandy. Yay. But now I want to write a web front-end to all of this, so I started