Create a new peer over the given transport.
AuthProvider
instances to use to authenticate with the other sideThe 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. In addition to the inherited behavior this will destroy the socket.
Get if a stream is available.
if a stream is currently set for this peer
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 a message over this peer.
promise that resolves when the message has been written
Set the stream being used for this peer.
Generated using TypeDoc
Peer that connects via a binary streaming protocol.