Is it possible to attach 2 connection in a website?

59 views
Skip to first unread message

kenneth thew

unread,
Apr 17, 2017, 3:59:53 AM4/17/17
to Strophe
Hi, I have two web chat application in a website.

1. Single chat
2. Group chat.

This two chat application are using strophe.js. After login with my bosh authentication. This two chat application will use attach(jid, sid, rid, callback) to attempt to connect to openfire server.

However, it seems like only 1 chat application will be able to connect, and the other will disconnect immediately. 

Is there any way for both the applications to connect to openfire server through the use of single login?

Best Regards
Kenneth

Daniel Dormont

unread,
Apr 17, 2017, 1:17:40 PM4/17/17
to str...@googlegroups.com
Hi,

Multiple "chats" don't require multiple connections. Just connect to
the bosh server, then using that connection, send whatever presences
you want, for example a "regular" presence so your private chat
concats can find you, and a groupchat presence.

Assuming you're talking about a single window of course. Multiple
windows will require multiple connections, generally.

dan
> --
> You received this message because you are subscribed to the Google Groups
> "Strophe" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to strophe+u...@googlegroups.com.
> To post to this group, send email to str...@googlegroups.com.
> Visit this group at https://groups.google.com/group/strophe.
> For more options, visit https://groups.google.com/d/optout.

kenneth

unread,
Apr 17, 2017, 10:25:51 PM4/17/17
to Strophe
Hi, thanks for the reply.

ya i am talking about having two different web chat application which is the single chat application and group chat application to integrate into 1 window.

I have separate single chat and group chat to become 2 independent web chat, and now i want to put this 2 web application into 1 window. 

After I login, i am able to save the session info, however both the web chat application uses attach(jid,sid,rid,onConnect), 
it disconnected immediately because the username@domain/resource is exactly the same for the 2 web chat application.
I think that XMPP does not allow user with same resource to be connect twice. 

What I want to create is using a single login, to connect the 2 different web chat application to the server with 1 username@domain/resource.

Sven-Erik Tiberg

unread,
Jun 26, 2017, 4:10:23 AM6/26/17
to Strophe
Hi
What about connect one chat application / instance to username@domain/home
and the other  chat application / instance to username@domain/office
with the same username@domain ?

Very interested to know if this work for you as I plan to use strophe in multi web-3D application and splitt up the package in parts to increase to update speed.

/Sven-Erik
Reply all
Reply to author
Forward
0 new messages