I'm trying to get the IP address of the computer I'm on, but both Unix.Inet_addr.of_string_or_getbyname and Unix.Host.getbyname return only the loopback address 127.0.0.1. How can I get the inet address of non-loopback network interfaces?
--
You received this message because you are subscribed to the Google Groups "ocaml-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The server has their address from the connection.
I believe you can create a udp socket and send a packet to the server and the use the api Sebastian pointed out to get your ip for that socket. This doesn't require the server doing anything.
But this is bound to be a pain in the but for any realistic setup.