The main difference then between p2p Message and ServerMessage is the delay and the presence of a server in the middle

P2P Message

  • In P2P messaging, the messages are sent through the WebRTC Data Channel  (through the peer connection.)
  • When you send a message to many peers through P2P messaging, you end up sending one-on-one messages to multiple people. 
  • P2P will be faster, but might end up bloating the sending peer.
  • P2P Messaging uses the RTCDataChannel where all data is secured with Datagram Transport Layer Security (DTLS).

Server Message:

  • In Server messaging,  messages are sent through the Signalling Server. 
  • The message is sent to the server which then broadcasts it to other peers.  
  • Relayed might add some latency, but is lighter on the sending peer.
  • Server messaging is useful when there are a lot of peers ( i.e.) to balance load.
  • This would allow (in the future) features such as asynchronous communication (e.g. store the message and send when the user comes online).