tethr.io
tethr.io provides a super-easy socket.io-like framework for managing peer-to-peer WebRTC data connections. This enables extremely fast and scalable applications and games built around small groups of clients communicating directly with each other!
tethr.io builds off the great work of WebRTC.io by wrapping their client library and simplifying the API until its dead simple for data streams.
This library focuses on data streams, and (currently) provides no mechanisms for video or audio streams (pull requests are encouraged!).
A great use for tethr.io is multiplayer games! I'm setting up an example game right now using tethr.io.
Install
The easiest way to install is to use browserify or component.
var tethr =
Or, if you must use a standalone build, one has been provided for you as tethr.io.js
Usage
The best way to describe it is by example!
var tethr = // Setup a connection to the backend to tell us of peerstethr // tethr is an EventEmitter, so we'll use events to communicatetethr // tethr can have errors, its good to bubble them uptethr // tethr can broadcast to all connected peers in the roomtethr // Here's the magic. This event fires when a peer joins the roomtethr
Backend
On the backend, you'll still need a webrtc.io signaling server, which webrtc.io provides. Just do the following:
var rtc = rtc
License
MIT License in LICENSE
file.