@hardpointlabs/sdk
    Preparing search index...

    Interface UnixSocketLike

    A handle to a UNIX socket connected to a service.

    Unlike a StreamLike which can be treated like a regular stream over TCP, you don't interact with this directly; instead, it exposes a path property which points to an ephemeral UNIX socket to be used in clients that can't accept a stream.Duplex directly.

    As with StreamLike, this should be disposed of properly when no longer needed to clean up associated network resources. See the main sdk.Sdk docs for details. Note that failing to dispose of this will not just leak the underlying tunnel socket, but it will also leave the UNIX socket listener open.

    interface UnixSocketLike {
        encryptionScheme: EncryptionScheme;
        path: string;
        remoteHost: string;
        remotePort: number;
        serviceName: string;
        "[asyncDispose]"(): PromiseLike<void>;
    }

    Hierarchy (View Summary)

    • Tunnel
    • AsyncDisposable
      • UnixSocketLike
    Index

    Properties

    encryptionScheme: EncryptionScheme

    The encryption scheme the tunnel is using.

    path: string

    Path to the listening UNIX socket.

    Until the owning UnixSocketLike object is disposed, it should be assumed that a listener is running at this path and is able to accept connections.

    In most serverless environments, the path is a random but unique location inside /tmp, but no assumptions should be made about where it is created, and callers should treat this as an opaque string.

    remoteHost: string

    The host that we're connected to on the other side of the network.

    This could be any IPv4 address, IPv6 address or valid hostname.

    This can be necessary for several use-cases, such as:

    • To perform SNI properly with a TLS-enabled service, or;
    • To pass the correct host header to an HTTP server which validates them
    remotePort: number

    The resolved port that we're connected to on the other side of the network.

    This could be any valid port number.

    serviceName: string

    Name of the service.

    This corresponds with the name of a service(s) in the Hardpoint Dashboard. See the documentation on services for more information.

    Methods

    • Returns PromiseLike<void>