peer-data

peer-data

  • Docs
  • Help
  • GitHub

›Examples

Quick Start

  • Installation
  • Basic Example
  • Signaling Server

Connection

  • Data Channel
  • Media Stream

Examples

  • Error Handling
  • Local connection
  • Socket signalling channel
  • Data channel example

Error Handling

Example

const room = peerData.connect('test-room');

room
    // you can catch errors here to know if the peer connection init failed
    .on("error", event => console.log(event));
    .on("participant", participant => {
            //here you can catch errors for ice candidates negotiation
            //and setting remote description (only for getting an answer)
            //remote description errors provided by offer are thrown by promise
            participant.on("error", event => {
                console.log("error", event);

                // You can renegotiate connection with peer by calling
                participant.renegotiate();
            })
    });
← Media StreamLocal connection →
  • Example
peer-data
Docs
Documentation
Community
Support
More
rafallorenz.comGitHubStar
Copyright © 2022 Rafał Lorenz