A Matrix-spec compliant server name.

It consists of a host and an optional port (separated by a colon if present).

Constructors

Accessors

Methods

Constructors

  • Parse/validate and create a new ServerName.

    Parameters

    • name: string

    Returns ServerName

Accessors

  • get host(): string
  • Returns the host of the server name.

    That is: Return the part of the server before :<port> or the full server name if there is no port.

    Returns string

  • get port(): null | number
  • Returns the port of the server name if any.

    Returns null | number

Methods

  • Returns true if and only if the server name is an IPv4 or IPv6 address.

    Returns boolean