问题
We are trying to implement a chat application where we are using strophe js for http-bind. Everything works fine, the only problem we are facing is with keeping connection alive with multiple tabs. I am not getting how to keep RID in sync when multiple tabs are open. Please help!!
回答1:
Each requesting resource should have it's own resource name. In your instance, each tab should have it's own resource name and connection.
username@jabber.servername.com/tab1
username@jabber.servername.com/tab2
You will then need to cc any messages to each resource to keep them up to date with messages. See: http://xmpp.org/extensions/xep-0280.html. Each resource will then have it's own RID.
来源:https://stackoverflow.com/questions/33451278/keep-rid-in-sync-with-multiple-tabs-for-strophe-js-connection