I recently changed my router over to one provided by Google for Google Fiber (yay!) and now I am noticing a change in what I am seeing when I inspect request.connection.remoteAddress while I develop on my local server. Before, I used to see this:
request.connection.remoteAddress; // 192.168.1.10
Now I am seeing this:
request.connection.remoteAddress; // ::ffff:192.168.1.10
- Can anyone explain what is going on?
- Is my Node server listening to IPv6 addresses?
- Is
::ffff:192.168.1.10
actually an IPv6 address or is it an IPv4 address? - Is the easiest way to tell if a remoteAddress is IPv6 to check if the string contains
::
? - When storing IPv4 addresses in the database I used to use something like
INET_ATON
to change them into large integers. Should I abandon this and just store all remote addresses as strings that can be 45 characters long (maximum length of an IPv6 address string)