Optionaloptions: AnswerOptionsTakes an offer for a WebRTC connection elsewhere, and creates an answer to connect that to this peer.
Returns a set of answer parameters: the answer itself, and a session to renegotiate the connection in future.
Creates an offer for a new external connection to this mock peer.
External connections are used for proxying traffic. They do not do anything by default (so they ignore this peer's configured steps) but a mock connection can be connected to an external connection using methods like thenPassThrough.
Returns a set of offer parameters: an external connection id, the offer itself, a session to renegotiate the connection in future, and a setAnswer callback to call with an answer once you have one.
Creates an offer for a new connection to this mock peer.
Returns a set of offer parameters: the offer itself, a session to renegotiate the connection in future, and a setAnswer callback to call with an answer once you have one.
Retrieve an array of all data channel messages that this peer has received on all connections.
Retrieve an array of all data channel messages on a specific channel that this peer has received on all connections.
Takes a connection id, and returns the associated session.
This is useful for advanced use cases, where keeping the session returned by other setup methods is inconvenient, and it's easier to keep ids and look up sessions on demand instead.
Takes an offer for a WebRTC connection elsewhere, and creates an answer to create an external connection to this peer.
External connections are used for proxying traffic. They do not do anything by default (so they ignore this peer's configured steps) but a mock connection can be connected to an external connection using methods like thenPassThrough.
Returns a set of answer parameters: an external connection id, the answer itself, and a session to renegotiate the connection in future.