WebRTC, WebSockets and Openfire

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.

Image2.jpg

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.
webrtc.html.zip (2285 Bytes)

3 Likes

Great stuff as always, Dele

Good news! would love to see an out-of-the-box Audio/Video setup bundled with OF

Great news, could you please any one share the document how we use ?

@all, thanks for the kind words of encouragement

@adam, i agree, it would nice for openfire to include a web client that has full audio/video support. I am hoping to get OfChat there some day.

@vanathu, do the following:

great work !

Dele and team,

I’ve just placed the websockets plugin into our production environment with 10+ clustered servers and a few thousand concurrent connections. At this point it’s running pretty well. However, I made a few modifications to account for resource accountability as we needed multiple sockets open on a per user/resource bases. I’ve also adjusted the plugin to work with the default WebSocketServlet rather than a general HttpServlet with the WebSocketsFactory. This was done for simplicity for now.

I’ll send something to you and Guus shortly for review. I just want to make sure it’s working for a day or two first.

Pat, Thanks for all your hard work in getting the websockets plugin to production quality. I am expecting Guus to add it to the core plugins after a successful review.

All,

I’ve submitted the plugin to Guus and Dele for review. It’s been running within my clustered environment for over a week now and has been running quite well and since it’s using sockets rather than BOSH it’s improved overall server performance.

Hopefully you all will see something soon that you can test yourself.