Here is a live-demo for Text-Chat + file sharing:
Here is the source-code:
Please disable following line if you don't want file sharing:
connection.enableFileSharing = true;
RTCMultiConnection is a big library, which is NOT for those who wanna understand WebRTC codes.
If you're learning WebRTC, then I'll suggest readthis this post:
Above post will explain how to create one-to-one data connection (text chat connection) between two users.
There is another post that explains how to implement mesh networking model to support text-chat between multiple users:
Many other relevant tutorials can be found here:
If you're looking for a good chat solution with socket.io fallback: