Description: [Suggestion] Secure Host Argument
Motivation and Context
Currently, the host argument is described as follows:
--host HOST, -H HOST The URL of the host trying to reach (default: speechcenter.verbio.com:2424)
Though the parameter exhibits a default value that serves the purpose of an example as well, any user could be blindly encourage to add an schema prefix. If said schema is provided to the gRPC library (e.g. https://speechcenter.verbio.com:2424), a misleading error is encountered stating that the DNS is unable to find/reach the host.
In order to avoid potential misuses, I would suggest using an URL parsing library (e.g. urllib.parse) to precisely gather the expected contents from the host parameter.
As a code example:
>>>import urllib.parse
# From either of the following examples, take SplitResult.hostname and SplitResult.port to compose the real gRPC host
>>>urllib.parse.urlsplit('speechcenter.verbio.com:2424')
SplitResult(scheme='', netloc='', path='speechcenter.verbio.com:2424', query='', fragment='')
>>> urllib.parse.urlsplit('http://speechcenter.verbio.com:2424')
SplitResult(scheme='http', netloc='speechcenter.verbio.com:2424', path='', query='', fragment='')
>>> urllib.parse.urlsplit('https://speechcenter.verbio.com:2424')
SplitResult(scheme='https', netloc='speechcenter.verbio.com:2424', path='', query='', fragment='')