• Opens HOPR session with the specified configuration.

    Parameters

    • payload: {
          apiEndpoint: string | URL;
          apiToken: string;
          capabilities?: null | ("Retransmission" | "Segmentation" | "RetransmissionAckOnly" | "NoDelay" | "NoRateControl")[];
          destination: string;
          forwardPath: {
              Hops?: number;
          };
          listenHost?: null | string;
          maxClientSessions?: null | number;
          maxSurbUpstream?: null | string;
          protocol: "udp" | "tcp";
          responseBuffer?: null | string;
          returnPath: {
              Hops?: number;
          };
          sessionPool?: null | number;
          target: {
              Plain: string;
          } | {
              Sealed: number[];
          } | {
              Service: number;
          };
          timeout?: number;
      }
      • apiEndpoint: string | URL

        The API endpoint for authentication.

      • apiToken: string

        The API token for authentication.

      • Optional capabilities?: null | ("Retransmission" | "Segmentation" | "RetransmissionAckOnly" | "NoDelay" | "NoRateControl")[]
      • destination: string
      • forwardPath: {
            Hops?: number;
        }
        • Optional Hops?: number
      • Optional listenHost?: null | string
      • Optional maxClientSessions?: null | number
      • Optional maxSurbUpstream?: null | string
      • protocol: "udp" | "tcp"
      • Optional responseBuffer?: null | string
      • returnPath: {
            Hops?: number;
        }
        • Optional Hops?: number
      • Optional sessionPool?: null | number
      • target: {
            Plain: string;
        } | {
            Sealed: number[];
        } | {
            Service: number;
        }
      • Optional timeout?: number

        optional timeout for the requests

    Returns Promise<{
        activeClients: string[];
        destination: string;
        forwardPath: {
            Hops?: number;
        };
        hoprMtu: number;
        ip: string;
        maxClientSessions: number;
        maxSurbUpstream?: null | string;
        port: number;
        protocol: "udp" | "tcp";
        responseBuffer?: null | string;
        returnPath: {
            Hops?: number;
        };
        sessionPool?: null | number;
        surbLen: number;
        target: string;
    }>

    A Promise that resolves to the opened session payload.

    Throws

    An error that occurred while processing the request.