Interface MockRTCPeerBuilder

The builder logic for composing RTC handling behaviour for both mock peers and rules, by internally queuing defined actions until a .thenX() method is called to compile the actions into either a peer or a rule (handled by an constructor callback param).

Hierarchy

Steps

Final Steps

  • Echo all incoming data channel messages until the other peer closes the connection.

    This defines a final step, and will then create a mock peer from the full set of steps you've defined, and return it wrapped in a promise. As soon as the promise resolves the peer is ready to use.

    Returns Promise<MockRTCPeer>

  • Creates a new external connection to the given remote peer connection, matching the existing mocked connection, and then proxies all traffic through to that peer.

    This defines a final step, and will then create a mock peer from the full set of steps you've defined, and return it wrapped in a promise. As soon as the promise resolves the peer is ready to use.

    Parameters

    • peer: RTCPeerConnection

    Returns Promise<MockRTCPeer>

  • Proxy this connection dynamically to the 'real' target peer, whoever that may be.

    This assumes that you have an existing external connection already set up and attached to this mock connection.

    You can do that either by using hookWebRTCConnection or hookAllWebRTC to hook your connection during normal setup to automatically create an external offer to the real remote peer, or you can do so manually using createExternalOffer or answerExternalOffer and then passing the connection id as here.

    This defines a final step, and will then create a mock peer from the full set of steps you've defined, and return it wrapped in a promise. As soon as the promise resolves the peer is ready to use.

    Returns Promise<MockRTCPeer>

Generated using TypeDoc