Pike v8.1 release 6

Method NetUtils.is_local_host()


Method is_local_host

bool is_local_host(RemoteAddressObject|string|int host, bool|void only_localhost)

Description

Returns true if host points to the local host.

Parameter host

The host to check

Parameter only_localhost

Only check if it is ipv6 or ipv4 localhost, not if it is one of the public IP# of this host.

Returns

true if the given host is the local host, false otherwise