@achingbrain/nat-port-mapper
    Preparing search index...

    Interface Gateway

    interface Gateway {
        family: "IPv4" | "IPv6";
        host: string;
        id: string;
        port: number;
        externalIp(options?: AbortOptions): Promise<string>;
        map(
            internalPort: number,
            internalHost: string,
            options?: MapPortOptions,
        ): Promise<PortMapping>;
        mapAll(
            internalPort: number,
            options?: MapPortOptions,
        ): AsyncGenerator<PortMapping, void, unknown>;
        stop(options?: AbortOptions): Promise<void>;
        unmap(internalPort: number, options?: AbortOptions): Promise<void>;
    }
    Index

    Properties

    family: "IPv4" | "IPv6"

    If IPv4, this gateway is capable of mapping IPv4 addresses, otherwise it will map IPv6 addresses

    host: string

    The network host that this gateway is accessible on

    id: string

    A unique identifier for this gateway

    port: number

    The port that this gateway uses

    Methods

    • Map a local host:port pair to one on the external network interface

      If the mapping is successful, the external port number that was mapped is returned - this may be different from the requested port number if that port was not free.

      Parameters

      • internalPort: number
      • internalHost: string
      • Optionaloptions: MapPortOptions

      Returns Promise<PortMapping>