Skip to content
docs

isPrivateHost

isPrivateHost(host): boolean

Defined in: url.ts:124

A host the wallet must not be pointed at from outside: the user’s own machine or network. Names: localhost, *.localhost, *.local, *.internal, *.home.arpa, *.lan. IPv4 in every form a URL parser accepts (127.1, 2130706433, 0x7f.0.0.1): 0/8, 10/8, 100.64/10, 127/8, 169.254/16, 172.16/12, 192.0.0/24, 192.168/16, 198.18/15, multicast and reserved; a numeric host that is no valid IPv4 counts as private too. IPv6: unspecified, loopback, unique-local, link-local, multicast, and the IPv4 inside a mapped (::ffff:…), compatible, NAT64 (64:ff9b::) or 6to4 (2002::) address; and any host that is not printable ASCII, which a URL parser would map to one of these (scan 2026-10-27 modules, F37). A public name that resolves to a private address (DNS rebinding) is not caught here.

string

boolean