Search from the end of the host/port combination to find the colon which
separates ip address from the port to accommodate ipv6 addresses.
diff --git a/Lib/httplib.py b/Lib/httplib.py
index a4102ea..2f117d8 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -524,7 +524,7 @@
 
     def _set_hostport(self, host, port):
         if port is None:
-            i = host.find(':')
+            i = host.rfind(':')
             if i >= 0:
                 try:
                     port = int(host[i+1:])