Changed url.py slightly to better handle IPv6 hosts

The old code wasn't parsing hosts like "[::1]:8000" properly, splitting them into ("[", ":1]:8000") instead of ("[::1]", "8000").

Rather using the rsplit() function and stripping the host of "[]" characters, one can better support IPv6 hosts.