Skip to content

parseEndpoint

parseEndpoint(text): NetEndpoint

Defined in: packages/net-address/src/port/endpoint.ts:78

Parses host, host:port, [v6] or [v6]:port, with the bracket form of RFC 3986 §3.2.2.

An IPv6 literal must be bracketed, so a port can never be mistaken for the final group. Inside the brackets a zone identifier is taken verbatim after %; RFC 6874’s %25 encoding is the caller’s to decode.

string

NetEndpoint

NetAddressSyntaxError When text is not an endpoint.