Added missing proxy type

This commit is contained in:
Kauppine 2021-04-10 08:29:28 +03:00
parent a93c7f6ef1
commit 121caadf6b

View File

@ -509,11 +509,13 @@ class Connect(object):
ws_proxy_port = None ws_proxy_port = None
ws_proxy_host = None ws_proxy_host = None
ws_proxy_auth = None ws_proxy_auth = None
ws_proxy_scheme = None
if conf.proxy: if conf.proxy:
ws_proxy_uri = _urllib.parse.urlsplit(conf.proxy) ws_proxy_uri = _urllib.parse.urlsplit(conf.proxy)
ws_proxy_port = ws_proxy_uri.port ws_proxy_port = ws_proxy_uri.port
ws_proxy_host = ws_proxy_uri.netloc.split(":")[0] ws_proxy_host = ws_proxy_uri.netloc.split(":")[0]
ws_proxy_scheme = ws_proxy_uri.scheme
if conf.proxyCred: if conf.proxyCred:
ws_proxy_auth = conf.proxyCred.split(":") ws_proxy_auth = conf.proxyCred.split(":")
@ -522,7 +524,7 @@ class Connect(object):
ws.settimeout(WEBSOCKET_INITIAL_TIMEOUT if kb.webSocketRecvCount is None else timeout) ws.settimeout(WEBSOCKET_INITIAL_TIMEOUT if kb.webSocketRecvCount is None else timeout)
ws.connect(url, header=("%s: %s" % _ for _ in headers.items() if _[0] not in ("Host",)), cookie=cookie, ws.connect(url, header=("%s: %s" % _ for _ in headers.items() if _[0] not in ("Host",)), cookie=cookie,
http_proxy_host=ws_proxy_host, http_proxy_port=ws_proxy_port, http_proxy_host=ws_proxy_host, http_proxy_port=ws_proxy_port,
http_proxy_auth=ws_proxy_auth) # WebSocket will add Host field of headers automatically http_proxy_auth=ws_proxy_auth, proxy_type=ws_proxy_scheme) # WebSocket will add Host field of headers automatically
ws.send(urldecode(post or "")) ws.send(urldecode(post or ""))
_page = [] _page = []