::1
is the true "local host" or "loopback" address, equivalent to 127.0.0.1
in IPv4.
::
is the "unspecified" or "null" address, equivalent to 0.0.0.0
in IPv4. Its main purpose is to refer to all possible local addresses when binding a socket to a local address – doing so is the opposite of using the loopback address.
The "unspecified" address does not mean "local host" officially – as far as I know, connecting to the unspecified address is not meant to be a valid operation, neither for [::]
nor 0.0.0.0
. (However, some operating systems accept it nevertheless – for example, in the Linux source code, there is a special case that handles connections to 0.0.0.0 as if they were connections to 127.0.0.1 with a comment saying "For compatibility with BSD", and it has similar handling for [::] simply to remain consistent with IPv4.)