Javascript
We wrote a script which implemented PeerJS and added some features.
- We added multichat. PeerJS connections are strictly one-to-one. To add multichat, we made it so that when a Peer starts a connection, it informs all of its current Peers of the new Peer’s ID and prompts them to connect as well.
- In this way all Peers are connected to all other Peers via several one-to-one connections. Then, if any Peer drops out all of the other Peer’s simply end that one connection and they can still communicate with everyone else.
- You can still whisper particular Peer’s in a group conversation.
- We added the option of public sharing of ID’s (powered by Twitter). PeerJS is set up in such a way that you must know another Peer’s ID in order to connect to them. This is great for private chat, but we wanted a public feature.
- We added the option to share your ID with the general public. We set up a bot to tweet your ID and a topic of your choice. The Tweets are displayed in the app so you can quickly connect to anonymous Peers to chat about topics you find interesting.
- We also added the option to save your chat log (powered by EverNote). Similar to the Twitter bot, we can automate posting of chats to Evernote.
- We wanted to add encryption, but we found out via research that WebRTC already implements some forms of encryption (AES encryption) plus we were running out of time :o