net-address
    Preparing search index...

    Class SocketAddrV6

    Represents an IPv6 socket address, consisting of an IPv6 address, a port number, and an optional flow label.

    const anySocketAddress = new SocketAddrV6(6372); // [::]:6372
    tcpServer.listen(anySocketAddress.asNodeListener(), () => {});
    udpSocket.bind(anySocketAddress.asNodeBind(), () => {});

    v0.0.1

    Index
    • Creates a new SocketAddrV6 instance.

      Parameters

      • options: number | { address?: Ipv6Addr; flowlabel?: number; port: number }

        The options for creating the socket address or a port number.

        • number
        • { address?: Ipv6Addr; flowlabel?: number; port: number }

      Returns SocketAddrV6

    address: Ipv6Addr

    IPv6 address of the socket address.

    v0.0.1

    family: "ipv6" = 'ipv6'

    Address family of the socket address.

    v0.0.1

    flowlabel?: number

    Optional flow label of the socket address.

    v0.0.1

    port: number

    Port number of the socket address.

    v0.0.1

    • Returns an object suitable for use as options in Node.js dgram.Socket.bind() method.

      Returns { address: string; port: number }

      An object containing the port and address properties.

      v0.1.0

    • Returns an object suitable for use as options in Node.js net.Server.listen() method.

      Returns { host: string; port: number }

      An object containing the port and host properties.

      v0.0.1

    • Compares this socket address with another for equality.

      Parameters

      • Optionalother: unknown

        The other socket address to compare with.

      Returns boolean

      true if the socket addresses are equal, false otherwise.

      v0.2.0

    • Returns a string representation of this socket address.

      Returns string

      The string representation in the format "[address]:port".

      v0.0.1

    • Creates a new SocketAddrV6 instance from a string representation or throws an error if the input is invalid.

      Parameters

      • value: string

        The string representation of the socket address in the format "[address]:port".

      Returns SocketAddrV6

      The SocketAddrV6 instance.

      v0.2.0