One last thing

If you host your content on an external domain we need your CORS headers to expose statistics for us to be able to analyze your data.

You can test if you need to change anything here.

Learn about CORS
Got it!

Gossip protocol

This is our implementation of Bimodal Multicast over webRTC, which we use to broadcast information in our peer-to-peer networks. The Gossip Protocol allows for a message to be broadcasted from one peer to the rest of the peers that it is connected to, after which those peers start to gossip. This makes it possible for one peer to broadcast a message that will be spread as far as the network reaches from this user, and without any ACKs we can be confident that every user has got the message.

Setup and use the gossip protocol:

You need to call greta.gossip.on with an event name and a callback for when we get a gossip message with that event name To start the gossiping about a message you call greta.gossip.broadcast with a list of events to gossip about

greta.gossip.on('user_reading_this', function(msg) {
   console.log(msg)
});

greta.gossip.broadcast([{
   event: 'user_reading_this',
   data: {
      message: '{"link":"https://greta.io"}'
  }
}]);