Skip to content

k.net.ping

Probe host connectivity and round-trip time with ICMP

ping()

ping(host) sends an ICMP request to a host name or IP address.

ParameterTypeRequiredDescription
hoststringYesHost name or IP address to probe

Returns: { ip: string, time: number, success: boolean }

FieldDescription
ipResolved IP address
timeRound-trip time in milliseconds
successWhether the ICMP request succeeded
ts
const result = k.net.ping("kooboo.com")

return {
    ip: result.ip,
    milliseconds: result.time,
    reachable: result.success
}