Creates a new data channel with the given name, waiting until it opens before continuing.
Send a message or buffer on the connection's data channels.
This can take one or two arguments. If only one is provided, it is used as a message that's sent on all open data channels. If two arguments are provided, the first must be the data channel label, and the message (the second) will be sent only to data channel(s) with that label.
If no matching channels are open, this is a no-op. Use waitForChannel()
to ensure the channels you're expecting are open first if necessary.
Wait for a given duration, in milliseconds
Wait until the remote client has created at least one DataChannel.
Optional
channelLabel: stringWait until the remote client next sends media data on a media track.
This waits for new media, ignoring any media already consumed by previous steps.
Wait until the remote client next sends a message to us on any DataChannel.
This looks for new messages, ignoring any messages already consumed by previous steps.
Wait until the remote client sends a message to us on a specific DataChannel.
This looks for new messages, ignoring any messages already consumed by previous steps.
Wait until the remote client has created at least one media track
Immediately close 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.
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.
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.
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.
Send a message or buffer on the connection's data channels, then close the
connection. This is equivalent to .send()
then
.thenClose()
.
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.
Generated using TypeDoc
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).