HomeGuidesAPI Reference
HubBlogChangelogSupport ForumLog In
API Reference

Node.js SDK - Peer

Home > @rainway/native > Peer

Peer class

An object representing a connection to a remote Rainway peer.

Signature:

export declare class Peer extends EventEmitter<PeerEvents> 

Extends: EventEmitter<PeerEvents>

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Peer class.

Properties

PropertyModifiersTypeDescription
connectionRainwayConnectionThe connection from which this peer was created.
dataChannelsReadonlyMap<string, DataChannel>A map from channel ids (labels) to Data Channels opened between us and this peer.
externalIdstringA string identifying this peer in your organization. For example: the "username" of the peer.
idBigIntThis peer's Rainway id.
outboundStreamsReadonlyMap<number, OutboundStream>A map from Stream IDs to active streams associated with this peer.
stateRainwayPeerStateThe peer's network connectivity state.

Methods

MethodModifiersDescription
close()Destroys the peer connection, including all sub resources.
createDataChannel(options)Creates a data channel.