beakman
Install
npm i -S beakman
Usage
As client: pick a server and send/receive messages
// Base configuration for WebRtc // Connect to a signaling server // Wait for broker to be connectedawait broker.connectedFuture; // Get the server list // Connect to a server // Listening messages FROM serverclientConnection.onDataObservable.add await clientConnection.awaitableConnected; // Send messages TO serverclientConnection.send'a message';
As server: host a room open for clients
// Connect to a signaling server // Wait for broker to be connectedawait broker.connectedFuture; // Listen for new connectionsawait broker.listen,
Signaling server
There is a naive implementation of the signaling server in the folder beakman-signaling.
Cloning the folder and running npm start
is enough to run the signaling server.
Running in Node.js
Node.js works out of the box as well as the browser. To run with Node it is necessary to provide wrtc
and ws
packages.
// Connect to a signaling server