libp2p
    Preparing search index...

    Interface Connection

    A Connection is a high-level representation of a connection to a remote peer that may have been secured by encryption and multiplexed, depending on the configuration of the nodes between which the connection is made.

    interface Connection {
        direction: Direction;
        encryption?: string;
        id: string;
        limits?: ConnectionLimits;
        log: Logger;
        multiplexer?: string;
        remoteAddr: Multiaddr;
        remotePeer: PeerId;
        rtt?: number;
        status: ConnectionStatus;
        streams: Stream[];
        tags: string[];
        timeline: ConnectionTimeline;
        abort(err: Error): void;
        close(options?: AbortOptions): Promise<void>;
        newStream(
            protocols: string | string[],
            options?: NewStreamOptions,
        ): Promise<Stream>;
    }
    Index

    Properties

    direction: Direction

    Outbound connections are opened by the local node, inbound streams are opened by the remote

    encryption?: string

    The encryption protocol negotiated for this connection

    id: string

    The unique identifier for this connection

    If present, this connection has limits applied to it, perhaps by an intermediate relay. Once the limits have been reached the connection will be closed by the relay.

    log: Logger

    The connection logger

    multiplexer?: string

    The multiplexer negotiated for this connection

    remoteAddr: Multiaddr

    The address of the remote end of the connection

    remotePeer: PeerId

    The id of the peer at the remote end of the connection

    rtt?: number

    The time in milliseconds it takes to make a round trip to the remote peer.

    This is updated periodically by the connection monitor.

    The current status of the connection

    streams: Stream[]

    A list of open streams on this connection

    tags: string[]

    A list of tags applied to this connection

    Lifecycle times for the connection

    Methods