Bun

class

net.SocketAddress

  • readonly address: string

    Either 'ipv4' or 'ipv6'.

  • readonly family: IPVersion

    Either 'ipv4' or 'ipv6'.

  • readonly flowlabel: number
  • readonly port: number
  • static parse(
    input: string
    ): undefined | SocketAddress;
    @param input

    An input string containing an IP address and optional port, e.g. 123.1.2.3:1234 or [1::1]:1234.

    @returns

    Returns a SocketAddress if parsing was successful. Otherwise returns undefined.