Project

General

Profile

XMPP Session accross all opened Tab of a browser

nurnabi siddique
Added about 5 years ago

Dear Altruists,

         if i create a user session from browser to tigase server, it is working fine. But when i open a new window i have to create another session for the same user. from web i got a concept shared bosh connection http://xmpp.org/extensions/inbox/shared-bosh.html. do you support it? or if not support is it possible to integrate with your existing bosh connection manager? what is your opinion?

Replies (10)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 5 years ago

Tigase does not support shared Bosh connection. It could be implemented but I am not sure if it would solve your problem.

As I understand your problem is that 2 windows compete with access to the same Bosh session. Shared Bosh connection would not solve that problem.

Added by nurnabi siddique about 5 years ago

is it possible using websocket? or are you thinking about any solution about it?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 5 years ago

We have too little information and details about your use case to suggest it a good solution.

For example, why creating another session is not good for you? Do you want to be able to communicate from all opened browser windows for the same user or just form the last opened (it would be more like moving session from one window to another). If you all windows active, how to you want to handle incoming messages - send it to all windows or just to active one or old one?

In any case, you need to find a solution on the client side (browser) not on the server side. The server cannot help you too much as it has nothing about multiple windows. The server may help a little bit but most of the work must be done on the client side.

Added by Steffen Larsen about 5 years ago

Hi,

Sorry for interrupting. But I think the stuff you need is probably some kind of pre-bind mechanism on the client side.

If you are using a browser and using e.g. Strophe.js then it supports a way to attach your users to a given session that already runs.

So you can use that for new tabs or reloads etc.

There is an example here: https://github.com/strophe/strophejs/tree/master/examples/attach

/Steffen

Added by nurnabi siddique about 5 years ago

i am developing a web based support chat system. we generate a java script code which we paste in every page of our website. so when visitor comes to our website chat option automatically will be prompted to visitor and if visitor initiate a chat with our support engineer then later when visitor switch to another webpage into another browser tab, we are facing problem to reuse our existing bosh session with tigase server.

what we can do currently

(1). if visitor refresh or reload the same page we can attach the existing xmpp connection. so there is no problem.

(2). if visitor switch to another tab we can initiate another chat session with same jid but using different resource. using message carbon server can forward message to all with same jid . to me it seems it will be a expensive operation.so i was looking for a solution where we can share our bosh connection across all tab of opened webpage of our webpage.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 5 years ago

I do not know a way to share a single Bosh session/connection between multiple chat clients opened in different tabs. However, I know that it is possible because this is what some of our customers do.

I think the second option to initiate new Bosh session for a new resource and using message carbons is not that bad. Why do you think it would be an expensive operation?

Added by nurnabi siddique about 5 years ago

(1). you told " I know that it is possible because this is what some of our customers do." Did your guyz implement session sharing for your customer?

(2). you told "If you all windows active, how do you want to handle incoming messages - send it to all windows or just to active one or old one?" it would be better just send to active one but is it possible to move current session from a tab to another tab what i was saying.

(3). It will be expensive from other sense like it shall reduce the scalability of the server. because it shall create multiple session from a single client. you know better.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 5 years ago

nurnabi siddique wrote:

(1). you told " I know that it is possible because this is what some of our customers do." Did your guyz implement session sharing for your customer?

No, the solution was done on the web client side, in web browser. We did not take part in the web client development. We only provided the server.

(2). you told "If you all windows active, how do you want to handle incoming messages - send it to all windows or just to active one or old one?" it would be better just send to active one but is it possible to move current session from a tab to another tab what i was saying.

Moving is relatively easy. You can reconnect to existing Bosh session using cookies. You can store SID and RID in a cookie and use them to reattach to the existing Bosh session on either page reload or on a new tab. You just have to make sure you deactivate client on the inactive tab.

(3). It will be expensive from other sense like it shall reduce the scalability of the server. because it shall create multiple session from a single client. you know better.

Well, how many concurrent users do you expect to have? And how many of them may open multiple windows/tabs with the web client? I mean realistically speaking.

Added by nurnabi siddique about 5 years ago

Actually, We are targeting service based support chat system(cloud chat). Like any website can integrate our chat service. so the subscriber will be huge from commercial perspective. lets say 1M. is it possible to support those huge number of figure through clustering tigase server? i am not sure about scalability of tigase server because i did not able test the capability. yet we are in beginning phase. so what is your suggestion? what do you think is it feasible to serve such a large system through current tigase server?

Again how many user may open multiple tab?. i think the number is huge because when visitor comes to website they always like to move to and fro.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 5 years ago

Tigase runs on installations with over 10 million online devices connected to the Tigase cluster. There are quite a few with over 1 million. So this should not be a problem. Especially that for a use case like this you do not expect to have a large contact list if any.

It is true that some users open multiple tabs but huge majority of users do not use tabs in web browsers extensively. Maybe your experience is different. It also depends what kind of users you expect to have. Anyway, a solution to handle it with a single session within a web browser exists as I know of some installations that solved this problem somehow. Unfortunately we are the server side guys not the web browser experts. So we cannot help you too much with this.

    (1-10/10)