Fix host parsing for ipv6 adresses

This adds a check, if the first character of the host is [, it means we have an ipv6 adress.