Ocamlnet supports IPv6 if the Ocaml runtime detects that IPv6 is available on the OS. For Win32 the Ocaml runtime has no IPv6 support.
Neturl module can parse URLs containing IPv6 addresses, e.g.
http://[fe80::224:7eff:fedf:59ff]/path. The address must be included
in square brackets, following common Internet standards. These square
brackets remain in place if the host part of the URL is extracted from
the URL with
Neturl.url_host. Note that
cannot process such brackets. Because of this, another function
Neturl.url_addr has been added which returns the IP address
For simple host/port pairs like
localhost:3128 another abstraction
has been added,
Netsockaddr.socksymbol_of_string one can parse such pairs, and IPv6
addresses are supported. Again, these addresses need to be enclosed in
The protocol interpreters for HTTP, FTP, and SOCKS have been carefully reviewed, and the necessary changes have been done.
The implementations for SMTP, POP, and the web connectors do not contain IP addresses (or are uncritical).
The central name service module is now
Uq_resolver. The name resolver
is now pluggable, and there are two versions:
gethostbyname, and is typically IPv4-only (but this is OS-dependent).
getaddrinfo, and supports both IPv4 and IPv6. One can set which address types are enabled.
getaddrinfomay not be available on all platforms, but it always available for platforms supporting IPv6.
gai_resolverin order to enable IPv6 name lookups:
It is OS-depended what else needs to be done to enable IPv6. For example, on Linux one needs