This module manages incoming and outgoing connections.

You can define how a connection between two participants can be reached (called a connection route) and this module will try to open a single connection between those two participants using those routes.

Routes can be enabled / disabled giving the user control of when and how to establish connections.

Constructors

Properties

onConnection: OEvent<((conn: default, localPublicKey: PublicKey, remotePublicKey: PublicKey, connectionRoutesGroupName: string, initiatedLocally: boolean) => void)> = ...
onConnectionViaCatchAll: OEvent<((conn: default, localPublicKey: PublicKey, remotePublicKey: PublicKey, connectionRoutesGroupName: string, initiatedLocally: boolean) => void)> = ...
onConnectionsChange: OEvent<(() => void)> = ...

Event is emitted when a connection is established or closed.

onOnlineStateChange: OEvent<((state: boolean) => void)> = ...

Event is emitted when the state of the connector changes. The event contains the value of the online state.

Accessors

Methods

  • Parameters

    • cryptoApi: CryptoApi
    • commServerUrl: string

    Returns {
        id: string;
        isNew: boolean;
    }

    • id: string
    • isNew: boolean
  • Parameters

    • cryptoApi: CryptoApi
    • host: string
    • port: number

    Returns {
        id: string;
        isNew: boolean;
    }

    • id: string
    • isNew: boolean
  • Parameters

    • cryptoApi: CryptoApi
    • remotePublicKey: PublicKey
    • commServerUrl: string
    • connectionRoutesGroupName: string

    Returns {
        id: string;
        isNew: boolean;
    }

    • id: string
    • isNew: boolean
  • Parameters

    • cryptoApi: CryptoApi
    • remotePublicKey: PublicKey
    • host: string
    • port: number
    • connectionRoutesGroupName: string

    Returns {
        id: string;
        isNew: boolean;
    }

    • id: string
    • isNew: boolean
  • Parameters

    • cryptoApi: SymmetricCryptoApiWithKeys
    • url: string
    • connectionRoutesGroupName: string

    Returns {
        id: string;
        isNew: boolean;
    }

    • id: string
    • isNew: boolean
  • Parameters

    • OptionallocalPublicKey: PublicKey
    • OptionalremotePublicKey: PublicKey
    • OptionalconnectionRoutesGroupName: string
    • OptionalcatchAll: boolean

    Returns void

  • Disables all routes matching the passed parameters.

    This also includes catch-all routes if only the localPublicKey and / or routeId is set.

    Parameters

    • OptionallocalPublicKey: PublicKey
    • OptionalremotePublicKey: PublicKey
    • OptionalconnectionRoutesGroupName: string
    • OptionalrouteId: string

    Returns Promise<void>

  • Enables all routes matching the passed parameters.

    This also includes catch-all routes if only the localPublicKey and / or routeId is set.

    Parameters

    • OptionallocalPublicKey: PublicKey
    • OptionalremotePublicKey: PublicKey
    • OptionalconnectionRoutesGroupName: string
    • OptionalrouteId: string

    Returns Promise<void>

  • Parameters

    • url: string
    • localPublicKey: PublicKey
    • remotePublicKey: PublicKey
    • connectionRoutesGroupName: string

    Returns boolean