Skip to content
Chris Petersen edited this page Oct 16, 2014 · 2 revisions

host-ipaddr returns host ip4 address as a u8vector, or #f. If more than one address is associated with the host, only the first entry in the address list will be returned.

Parameter Description
name Optional: Hostname to resolve

Example

Example 1: Get my machine's ip address, with an internet connection present

> (ipaddr->string (host-ipaddr "localhost"))
"192.168.31.2"

Example 2: Get my machine's ip address, without internet connection available > (ipaddr->string (host-ipaddr "localhost")) "127.0.0.1"

Clone this wiki locally