Create a new peer over the given transport.
The unique identifier of this peer.
Get the current latency.
estimated latency to the peer in milliseconds
Abort a connection.
Callback for when a peer has connected.
Manually disconnect this peer.
Force a connection without performing negotiation.
Handle disconnect event. This implementation will log info about the disconnect and then mark the peer as disconnected.
Transports may override this to provide reconnection behavior.
Get a buffer representing a publicly known security challenge for the local side of the peer.
buffer with challenge or undefined
Initiate negotiation as the client. This will switch the peer into a client mode and wait for the initial Hello from the server.
Initiate negotiation as the server. This will send the initial Hello to the client and this peer will start waiting for a reply.
Receive a message from the peer. This will method is responsible for checking the state of the peer and routing messages to their correct locations.
Get a buffer representing a publicly known security challenge for the remote side of the peer.
buffer with challenge or undefined
Request that this peer disconnects.
Send data to this peer.
Generated using TypeDoc
Abstract implementation of a peer suitable for use with a WebSocket instance.