Readonly
peerTakes 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.
Optional
options: 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.
Optional
options: AnswerOptionsCreates 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.
Optional
options: OfferOptionsCreates 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.
Optional
options: OfferOptionsTakes 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.
Generated using TypeDoc
A MockRTC peer represents a target you can connect to, and exposes an API to create offers or answers to create new connections.
Peers have defined behaviour, and each connection will be handled accordingly and independently.
Peers can also optionally track all the messages and metadata across all their connections.