PeerServer: A server for PeerJS
PeerServer helps broker connections between PeerJS clients. Data is not proxied through the server.
http://peerjs.com
If you prefer to use a cloud hosted PeerServer instead of running your own, sign up for a free API key here
or
Run PeerServer
Install the library:
$> npm install peer
Run the server:
$> peerjs --port 9000 --key peerjs
Or, create a custom server:
var PeerServer = PeerServer;var server = ;
Connecting to the server from PeerJS:
Using HTTPS: Simply pass in PEM-encoded certificate and key.
var fs = ;var PeerServer = PeerServer; var server = ;
Running PeerServer behind a reverse proxy
Make sure to set the proxied
option, otherwise IP based limiting will fail.
The option is passed verbatim to the
expressjs trust proxy
setting
if it is truthy.
var PeerServer = PeerServer;var server = ;
Combining with existing express app
var express = ;var app = ;var ExpressPeerServer = ExpressPeerServer; app; var server = app; var options = debug: true app; // OR var server = ; app; server;
Events
The 'connection'
event is emitted when a peer connects to the server.
server;
The 'disconnect'
event is emitted when a peer disconnects from the server or
when the peer can no longer be reached.
server;
Problems?
Discuss PeerJS on our Google Group: https://groups.google.com/forum/?fromgroups#!forum/peerjs
Please post any bugs as a Github issue.