3 ms·
Doesn't it iterate over IPv6 addresses a few lines down? [1]. Sure, it iterates through IPv4 first, but does it make sense to prefer IPv6 given that IPv4 is sti
by blakesmith 13y ago
Doesn't it iterate over IPv6 addresses a few lines down? [1]. Sure, it iterates through IPv4 first, but does it make sense to prefer IPv6 given that IPv4 is still the most popular?
1. https://github.com/joyent/node/blob/master/src/cares_wrap.cc#L906 https://github.com/joyent/node/blob/master/src/cares_wrap.cc...
- simon_vetter 13y agoYes, it will connect just fine over v6 if no v4 addresses are available. It should, however, try v6 first and then fall back to v4. At least on Linux and OSX, getaddrinfo() won't return ipv6 addresses if the local machine doesn't have any global ipv6 address, which means that a server without ipv6 connectivity won't waste any cycle trying to use addresses it can't reach. Preferring v4 means that you'll never shift your traffic over to v6 unless v4 is shut down. Because networks and services are going to be dual stack for as long as sysadmins see substantial v4 traffic, such behavior will create another chicken and the egg problem. It will also put more strain on the network (as traffic will eventually have to go through multiple layers of NAT, etc), render operations more difficult (how do I know who made that request if an entire datacenter is behind one or two ip addresses?), and in the end, make network operations more expensive, because we'll have to run dual stack longer than necessary.
- blakesmith 13y agoThanks for following up and clarifying!