parse passed host before using

This uses the net/url package to attempt to parse a url scheme before falling back to the raw string passed.

Same as the PR for the python version