Skip to main content

Peer-to-Peer

The library has implemented a particular subset of options for peer-to-peer connectivity. It leverages the connectivity from Peer.js by creating several levels of abstractions through the inclusion methods that are event-driven.

Architecture

The connection between two peers is established once the users login to the server.

web-sockets

Connect

To instantiate an insance of the library, you create the following options:

let client = new HydroRTCClient('user-name')
//Once the client is connected to the server:
client.on('connect', (data) => {
//Option to feed the web application
})

A user can request who has logged in by utilizing the following command:

let connectedClients = client.getPeers()

This list will be available as an array that can be used to populate an HTML list that can be accessed by all the connected users.

Note

Default configuration is that the steps are not linked.

Tip

More about graph scheduling here.