The _url.py file

websocket._url.get_proxy_info(hostname, is_secure, proxy_host=None, proxy_port=0, proxy_auth=None, no_proxy=None, proxy_type='http')[source]

Try to retrieve proxy host and port from environment if not provided in options. Result is (proxy_host, proxy_port, proxy_auth). proxy_auth is tuple of username and password of proxy authentication information.

  • hostname (str) – Websocket server name.

  • is_secure (bool) – Is the connection secure? (wss) looks for “https_proxy” in env before falling back to “http_proxy”

  • proxy_host (str) – http proxy host name.

  • http_proxy_port (str or int) – http proxy port.

  • http_no_proxy (list) – Whitelisted host names that don’t use the proxy.

  • http_proxy_auth (tuple) – HTTP proxy auth information. Tuple of username and password. Default is None.

  • proxy_type (str) – Specify the proxy protocol (http, socks4, socks4a, socks5, socks5h). Default is “http”. Use socks4a or socks5h if you want to send DNS requests through the proxy.


parse url and the result is tuple of (hostname, port, resource path and the flag of secure mode)


url (str) – url string.