Close the connection when finished with it.
Assume HTTP if no protocol is specified but url starts with '//'. Added a unit test for this.