When one user (user_one) wants to have a private chat with another user (user_two) you obviously need something in the UI to trigger this.Say user_one clicks on something next to user_two that indicates they want a one-to-one chat.
When this happens a request should be made to the server (the authority) to indicate that user_one wants to initiate the private chat with user_two†. maybe you want to ensure the channel name is always the same between the two users).
In our simple scenario the channel name would be private-chat-user_one-user_two.
They're just not pure white sand - they're mostly made of pebbles." Jana, 13, Vancouver, Canada "The beaches in Dover are quite dirty due to all the ships leaving from there.
But if you go to some around Dover there are lovely beaches." Ben, 12, Kent, England "The beach near my home is so dirty and pebbly that it's horrible to even look at!
This article will cover a common scenario when trying to add private one-to-one user chat to your web application.