How to detect a channel disconnect event with Faye

I am trying to make chat on my website look like google talk. I want to manage the disconnect event. The user can disconnect from several ways:

  • By pressing the disconnect button (easy to push the event to his friends)
  • Close its windows (I can send an event to windows to close javascript, but if the user has many windows open on my website, I don’t want to disable it.)

So, how can I detect when my channel connection is closed? Each user has his own channel with his identifier.

Thanks for the help.

+5
source share
1 answer

You can check meta events, /meta/unsubscribeand /meta/disconnect.

: Faye Monitoring

+4

All Articles