WebURL Documentation Beta

Enumeration Web​URL.​Host

public enum Host 

A host is a domain, an IPv4 address, an IPv6 address, an opaque host, or an empty host. Typically a host serves as a network address, but it is sometimes used as opaque identifier in URLs where a network address is not necessary.

The URL Standard defines the allowed scheme/host combinations:

  • The host of a http, https, ftp, ws, or wss URL is always either a domain, an IPv4 address, or an IPv6 address.

  • The host of a file URL is always either a domain, an IPv4 address, an IPv6 address, or the empty host.

  • The host of any other URL is always either an opaque hostname, an IPv6 address, the empty host, or nil (no host).

Member Of

WebURL

A Uniform Resource Locator (URL) is a universal identifier, which often describes the location of a resource.

Conforms To

CustomStringConvertible

Enumeration Cases

ipv4Address

case ipv4Address(IPv4Address)

An Internet Protocol, version 4 address.

ipv6Address

case ipv6Address(IPv6Address)

An Internet Protocol, version 6 address.

domain

case domain(String)

A domain is a non-empty ASCII string which identifies a realm within a network.

opaque

case opaque(String)

An opaque host is a non-empty ASCII string which can be used for further processing. The name may contain non-ASCII characters or other forbidden host code-points in percent-encoded form.

empty

case empty

An empty hostname.

Properties

description

public var description: String 

serialized

public var serialized: String 

The string representation of this host.

The serialization format is defined by the URL Standard. This is the same as the URL's hostname property.