Dele Olajide

WebRTC, WebSockets and Openfire

Blog Post created by Dele Olajide Champion on Feb 14, 2012

For those who are following, WebRTC is a free, open project that enables web browsers with Real-Time Communications (RTC) capabilities via simple Javascript APIs and is now available for Chrome.


A while ago, I implemented a Websocket plugin for Openfire that uses Jetty 7.5. Work is already under way by community member Pat Santora to make it a core plugin for Openfire.


WebRTC with WebSockets when fully functional, will enable audio and video conferencing from a web browser without the need for a browser plugin like Flash and even a media server like Red5. The media connection will be peer to peer directly between browsers and the signaling can be SIP, Jingle or whatever over a WebSocket connection or HTTPRequest.


To see how WebRTC compares to Flash Player with RTMFP, I created a simple web page demo using the WebSockets plugin for Openfire and JavaScript and tested with the latest Chrome Canary 19.0.1041.




Performance is good, but it is still early days as the WebRTC specification is still evolving. There are active debates on signaling, device capability discovery and where to hide the the complex code; JavaScript libraries or the Browser. For those who want to see what's under the hood, I have attached the single web page. Run two instances from two different PCs. Change the JavaScript to suit your own Openfire server.


I think I have enough to get started on adding two-way Jingle Audio/Video to the OfChat web client using a WebRTC compatible transport.