A P2P-based chat application is difficult to build because of the NAT firewalls in which most users are.
You can study the IETF standards such as ICE , STUN , TURN , SIP and son on. Although their implementation is the task of Hercules.
But,
RTMFP is a simple solution for implementing a P2P voice and video chat application. It is developed by Adobe and can be easily used by any flash developer in its application. It is easy and simple to implement. To do this, you just need to know flash development. Also check out Adobe Cirrus and Adobe AIR for desktop applications.
Hurrah!!!
source share