strophe

Parsing XML websocket responses with Strophe.js

假装没事ソ 提交于 2020-01-16 18:53:06
问题 I'm using Strophe.js to connect to an XMPP server via websockets. Here's a sample response I get when the connected user receives a message: <message xmlns='jabber:client' xml:lang='en' to='agent@chat.domain.com/6665193359253278721998' from='client@chat.domain.com/Mac' type='chat' id='purple42fccc5c'> <archived by='agent@chat.domain.com' id='1557026681122740' xmlns='urn:xmpp:mam:tmp'/> <stanza-id by='agent@chat.domain.com' id='1557026681122740' xmlns='urn:xmpp:sid:0'/> <active xmlns='http:/

facebook chat using strophe, punjab

有些话、适合烂在心里 提交于 2020-01-06 03:08:13
问题 using the answer of my previous question and another post I tried to implement facebook-chat from a browser. Here is what I did: on an ubuntu virtual machine, I have python 2.6.5 , python-twisted-conch 1:10.0.0-2 , python-twisted-names 10.0.0-1 , python-twisted-web 10.0.0-1 and python-twisted-words 10.0.0-2 already installed. I did not install jabberd2 server, I assumed facebook server is the Jabber/XMPP server in my case. Also I did not install pyopenssl. downloaded and untared punjab from

How to get openfire chat room messages history

假如想象 提交于 2020-01-05 10:11:10
问题 I use Strophe library to connect to an OpenFire XMPP server. How can I receive the chat room messages history ? var o = {to:'roomName@conference.domain.com/youNick'}; var m = $pres(o); m.c('x', {xmlns : 'http://jabber.org/protocol/muc#user'}, null); connection.send(m.tree()); I get only 25 messages when I join room. How to get past 25 message of the chat room ? 回答1: You should add a <history/> element: https://xmpp.org/extensions/xep-0045.html#enter-managehistory. <x xmlns='http://jabber.org

run javascript at serverside

青春壹個敷衍的年華 提交于 2019-12-24 02:13:06
问题 Is there any way to run one same instance of JavaCcript(jQuery) on the server side and call it from a Java method? :) I am interested to know whether it is possible to run it on the server side (not clientside), like Google app engine. 回答1: Rhino. Apparently it supports a few javascript libraries, including jquery. http://ejohn.org/blog/bringing-the-browser-to-the-server/ 回答2: Jaxer by Aptana is the first Ajax server. It has a javascript capability for the server-side. Whether it does what

Resuming XMPP connection upon page refresh

╄→尐↘猪︶ㄣ 提交于 2019-12-23 04:55:49
问题 I am not able to maintain the connection on page refresh. Initially upon every refresh Strophe connection object is lost. So, the first approach I took was reconnecting on refresh. I am saving the JID, SID and RID in localStorage send the strophe attach call with saved details. AuthHandler.attach_params(jid_frm_storage, sid_frm_storage, rid_frm_storage); The attach callback is in actual AuthHandler Object that I have created and is logging perfectly that means it is okay to assume that my

file transfer in multi user chat to muliple users

妖精的绣舞 提交于 2019-12-22 19:13:09
问题 i want to send files to multiple users in a one chat room so that i will be broadcasted to everyone. so far i havent found anything or any help on internet which resolve this issue. currently what i tried is to send a single file to each users one by one but i think that is not an efficient way so if someone has another approach then please do let know. i have tried sending file using si-filetransfer and bystream also. socks5 bytestream is not possible in javascript i guess so i havent tried

XMPP: retrieving BOSH Session ID and RID

心不动则不痛 提交于 2019-12-22 11:06:56
问题 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. 回答1: 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',

Session resume problem with Strophe attach and Ejabberd

不问归期 提交于 2019-12-22 09:14:15
问题 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

Strophe sending double request on page unload

╄→гoц情女王★ 提交于 2019-12-21 19:31:30
问题 I have written an XMPP client with jQuery+Strophe. It all works well (1-on-1, presence, MUC, etc) and is contained within a jQuery-plugin. However, when the page unloads, it sends 2 final requests with the same rid. It only recently became a problem when I started working on session attachment. Here is an example of the Firebug console: Here, I just logged in and immediately refreshed the page. The first post you see is the initial presence stanza after the login. After that request, a new