URLs always have this format:
<protocol>://<host>[:<port>]/[<path>][#<hash>]
The problem is that IPv6 uses colons, just like the separator of port and host, e.g:
2001:db8:1f70::999:de8:7648:6e8
But what if this is the host, and I want to connect to it with HTTP on port 100?
http://2001:db8:1f70::999:de8:7648:6e8:100/
The problem is the last colon. Since zero's are omitted with double colons (between 1f70 and 999), it's unknown if ':100' belongs to the IP or the port number. How can we know this?
The notation in that case is to encode the IPv6 IP number in square brackets:
That's RFC 3986, section 3.2.2: Host