Skip to main content

isPrivateHost

@forge/monorepo


@forge/monorepo / backend/src / isPrivateHost

Function: isPrivateHost()

isPrivateHost(host): boolean

Defined in: backend/src/mcp/egress.ts:49

Private/loopback/link-local detection for a host (name or IP literal). Blocks the obvious private ranges, and — importantly — every IPv6 literal by default: an IPv4-mapped form like ::ffff:169.254.169.254 otherwise slips a metadata address past a naive v4-only check. A specific public IPv6 endpoint must instead be permitted explicitly via allowedHttpHosts.

Parameters

host

string

Returns

boolean