support for "keep-alive" connections

when HTTP request is done, and Connection header is "keep-alive" HTTP client puts the connection into internal cache.
This connection will be used for the next requests to the same server (the same endpoint: host name and port)
two-phase resolving

the first attempt uses protocol name of the URL as a service name
the second attempt uses port number as a service name

because some platforms doesn't support name resolution with protocol names