Allow ipv6 address in url

Followup for #199

Maybe it would be nicer to put all those changes into one single file.