BUG: ensure port is converted to an int in proxy handling.
REF: improve scheme parsing and don't use private _parse_proxy.