libp2p
    Preparing search index...

    Interface ConnectionGater

    interface ConnectionGater {
        denyDialMultiaddr(multiaddr: Multiaddr): boolean | Promise<boolean>;
        denyDialPeer(peerId: PeerId): boolean | Promise<boolean>;
        denyInboundConnection(
            maConn: MultiaddrConnection,
        ): boolean | Promise<boolean>;
        denyInboundEncryptedConnection(
            peerId: PeerId,
            maConn: MultiaddrConnection,
        ): boolean | Promise<boolean>;
        denyInboundRelayedConnection(
            relay: PeerId,
            remotePeer: PeerId,
        ): boolean | Promise<boolean>;
        denyInboundRelayReservation(source: PeerId): boolean | Promise<boolean>;
        denyInboundUpgradedConnection(
            peerId: PeerId,
            maConn: MultiaddrConnection,
        ): boolean | Promise<boolean>;
        denyOutboundConnection(
            peerId: PeerId,
            maConn: MultiaddrConnection,
        ): boolean | Promise<boolean>;
        denyOutboundEncryptedConnection(
            peerId: PeerId,
            maConn: MultiaddrConnection,
        ): boolean | Promise<boolean>;
        denyOutboundRelayedConnection(
            source: PeerId,
            destination: PeerId,
        ): boolean | Promise<boolean>;
        denyOutboundUpgradedConnection(
            peerId: PeerId,
            maConn: MultiaddrConnection,
        ): boolean | Promise<boolean>;
        filterMultiaddrForPeer(
            peer: PeerId,
            multiaddr: Multiaddr,
        ): boolean | Promise<boolean>;
    }
    Index

    Methods

    • denyDialMultiaddr tests whether we're permitted to dial the specified multiaddr.

      This is called by the connection manager - if the peer id of the remote node is known it will be present in the multiaddr.

      Return true to prevent dialing the passed peer on the passed multiaddr.

      Parameters

      Returns boolean | Promise<boolean>

    • denyDialPeer tests whether we're permitted to Dial the specified peer.

      This is called by the dialer.connectToPeer implementation before dialling a peer.

      Return true to prevent dialing the passed peer.

      Parameters

      Returns boolean | Promise<boolean>

    • denyInboundEncryptedConnection tests whether a given connection, now encrypted, is allowed.

      This is called by the upgrader, after it has performed the security handshake, and before it negotiates the muxer, or by the directly by the transport, at the exact same checkpoint.

      Return true to deny the passed secured connection.

      Parameters

      Returns boolean | Promise<boolean>

    • denyInboundRelayedConnection tests whether a remote peer is allowed to open a relayed connection to this node.

      This is invoked on the relay client when a remote relay has received an instruction to relay a connection to the client.

      Return true to deny the relayed connection.

      Parameters

      Returns boolean | Promise<boolean>

    • denyOutboundEncryptedConnection tests whether a given connection, now encrypted, is allowed.

      This is called by the upgrader, after it has performed the security handshake, and before it negotiates the muxer, or by the directly by the transport, at the exact same checkpoint.

      Return true to deny the passed secured connection.

      Parameters

      Returns boolean | Promise<boolean>

    • denyOutboundRelayedConnection tests whether a remote peer is allowed to open a relayed connection to the destination node.

      This is invoked on the relay server when a source client with a reservation instructs the server to relay a connection to a destination peer.

      Return true to deny the relayed connection.

      Parameters

      Returns boolean | Promise<boolean>