Getting started with WebSocket API in ejabberd
Summary
The WebSocket API, as neatly explained by the MDN, is a technology that makes it possible to open a two-way interactive communication session between the user’s browser and a server. ConverseJS is a very nice XMPP client for web browsers that supports BOSH and WebSocket API. And we want to use WebSocket API instead of BOSH: In order for the above ConverseJS initialiser to work, you need to create a new ejabberd user, for example with password . There are other authentication methods described in the ConverseJS docs that enable secure ways to handle user’s password. To make the widget look more like a quick chat window instead of an IM messenger, you can paste the following CSS style right after the initialiser section: At this point, if you open the HTML page, a popup will appear asking just for the nickname and then connecting via WebSocket API straight to chat room.