function isPrivateHostname
isPrivateHostname(url: URL): boolean

Checks whether the host of url is private without a DNS lookup: a private IP address, or localhost and its subdomains. isValidHttpUrl uses it to reject a link early; only resolvePublicAddress is a real guard.

Parameters

url: URL

Return Type

boolean

Usage

import { isPrivateHostname } from "api/remote/public-address.ts";