Working with IPv6
Please recall the hints.ai_family = AF_INET part of time_server.c near the beginning of the main() function. If this line is changed to hints.ai_family = AF_INET6, then your web server listens for IPv6 connections instead of IPv4 connections. This modified file is included in the GitHub repository as time_server_ipv6.c.
In this case, you should navigate your web browser to http://[::1]:8080 to see the web page. ::1 is the IPv6 loopback address, which tells the web browser to connect to the same machine it's running on. In order to use IPv6 addresses in URLs, you need to put them in square brackets, []. :8080 specifies the port number in the same way that we did for the IPv4 example.
Here is what you should see when compiling, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access