PeerJS: Simple peer-to-peer with WebRTC
PeerJS provides a complete, configurable, and easy-to-use peer-to-peer API built on top of WebRTC, supporting both data channels and media streams.
http://nttcom.github.io/skyway
Setup
Include the library
Create a Peer
Get a free API key. Your id only needs to be unique to the namespace of your API key.
var peer = 'pick-an-id' key: 'myapikey'; // You can pick your own id or omit the id if you want to get a random one from the server.
Data connections
Connect
var conn = peer;conn;
Receive
peer;
Media calls
Call
navigatorgetUserMedia = navigatorgetUserMedia || navigatorwebkitGetUserMedia || navigatormozGetUserMedia;navigator;
Answer
navigatorgetUserMedia = navigatorgetUserMedia || navigatorwebkitGetUserMedia || navigatormozGetUserMedia;peer;