Module circuit/circuit/hop

Index

Type aliases

CircuitRequest

CircuitRequest: { dstPeer: { addrs: Uint8Array[]; id: Uint8Array }; srcPeer: { addrs: Uint8Array[]; id: Uint8Array }; type: CircuitType }

Type declaration

  • dstPeer: { addrs: Uint8Array[]; id: Uint8Array }
    • addrs: Uint8Array[]
    • id: Uint8Array
  • srcPeer: { addrs: Uint8Array[]; id: Uint8Array }
    • addrs: Uint8Array[]
    • id: Uint8Array
  • type: CircuitType

Connection

Connection: Connection

HopRequest

HopRequest: { circuit: Transport; connection: Connection; request: CircuitRequest; streamHandler: StreamHandler<{ dstPeer: CircuitPeer; srcPeer: CircuitPeer; type: CircuitType }> }

Type declaration

StreamHandlerT

StreamHandlerT: StreamHandler<{ dstPeer: CircuitPeer; srcPeer: CircuitPeer; type: CircuitType }>

Transport

Transport: Circuit

Functions

canHop

  • canHop(__namedParameters: { connection: Connection }): Promise<boolean>
  • Performs a CAN_HOP request to a relay peer, in order to understand its capabilities.

    Parameters

    Returns Promise<boolean>

Private handleCanHop

handleHop

hop

  • Performs a HOP request to a relay peer, to request a connection to another peer. A new, virtual, connection will be created between the two via the relay.

    Parameters

    Returns Promise<Connection>