Pinggy SDK - v0.1.3
    Preparing search index...

    Class Tunnel

    Represents a Pinggy tunnel instance, managing its lifecycle and forwarding. Handles authentication, forwarding, and additional tunnel operations via the native addon. Implements the Tunnel interface.

    Implements

    • Tunnel
    Index

    Constructors

    • Creates a new Tunnel instance and initializes it with the provided config reference.

      Parameters

      • addon: PinggyNative

        The native addon instance.

      • configRef: number

        The reference to the native config object.

      Returns Tunnel

    Methods

    • Gets the list of public URLs for the tunnel.

      Returns string[]

      The list of public tunnel URLs.

    • Starts the tunnel, handles authentication and forwarding, and returns the public URLs.

      Returns Promise<string[]>

      Resolves with the list of public tunnel URLs.

      If tunnel connection or forwarding fails.

    • Starts web debugging for the tunnel on the specified local port.

      Parameters

      • listeningPort: number

        The local port to start web debugging on.

      Returns Promise<void>

      Resolves when web debugging is started.

      If web debugging fails to start.

    • Checks if the tunnel is currently active.

      Returns boolean

      True if the tunnel is active, false otherwise.

    • Requests additional forwarding for the tunnel.

      Parameters

      • remoteAddress: string

        The remote address to forward from.

      • localAddress: string

        The local address to forward to.

      Returns Promise<void>

      Resolves when additional forwarding is set up.

      If additional forwarding fails.

    • Stops the tunnel and cleans up resources.

      Returns boolean

      True if the tunnel was stopped successfully, false otherwise.

      If stopping the tunnel fails.

    Properties

    authenticated: boolean

    Whether the tunnel is authenticated.

    primaryForwardingDone: boolean

    Whether primary forwarding is complete.

    status: "starting" | "live" | "closed"

    Current status of the tunnel.

    tunnelRef: number

    Reference to the native tunnel object.