Skip to content
0-8-15 edited this page May 23, 2019 · 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