I am currently looking at adding peer2peer support to Openfire using the Redfire plugin which has support for both RTMP and the new RTMFP (peer to peer) protocol from Adobe. I would like to get some feedback from the community to validate my thinking and confirm I am on the right track.
I know that I should be looking at Jingle and I also know I should be looking at XEP-0174: Serverless Messaging, but they don't serve my needs and the XMPP council had reservations about my RTMP ideas for Jingle because RTMP and RTMFP are considered proprietary. Unfortunately, Flash Player has not gone away and the open HTML5 websockets is still taking its first steps as a toddler.
I have developed a new client-side RTMFP connection class for XIFF that enables clients to dynamically become nodes or supernodes (like Skype) using RTMP and RTMFP. Nodes will connect and distribute messages to each other without a server using RTMFP, while super-nodes will connect to Openfire via the Redfire connection manager using RTMP and act as proxies for their neighbour nodes. Like Openfire clustering, disconnecting super-nodes are replaced immediately by election among the neighbour nodes.
XMPP Message packets between neighbours can be sent directly peer to peer if there is a route and server messaging logging is not mandatory.
In theory, a fully populated enterprise muticast 192.168.x.x network with aproximately 64K users would only need 256 Openfire socket connections
As a first step towards Openfire peer2peer, the latest version of the Redfire plugin for Spark has support for RTMFP. If there is a route between clients having a two-way chat or multi-user chat, then the audio and video is sent peer2peer using RTMFP. There should be some performance gains with multiple participants in a chat room. Screenshare and remote desktop control is still done via Openfire server using RTMP with Red5.