diff options
author | engn33r <engn33r@users.noreply.github.com> | 2022-08-25 00:00:00 +0000 |
---|---|---|
committer | engn33r <engn33r@users.noreply.github.com> | 2022-08-25 00:00:00 +0000 |
commit | 7a33095acd3a2e053b982cad3fbf07a5e5c9a124 (patch) | |
tree | a406d44e664fc62e05274fee255cebf00e88cbc5 | |
parent | dc2a521c81c11a6e6f8e19ca2c647a6cc373ca01 (diff) | |
download | websocket-client-7a33095acd3a2e053b982cad3fbf07a5e5c9a124.tar.gz |
revert fc525b1, http proxy uses URL port unlike SOCKS proxies
-rw-r--r-- | websocket/_http.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/websocket/_http.py b/websocket/_http.py index 53c1152..17d3f8a 100644 --- a/websocket/_http.py +++ b/websocket/_http.py @@ -114,22 +114,22 @@ def connect(url, options, proxy, socket): if proxy.proxy_host and not socket and not (proxy.proxy_protocol == "http"): return _start_proxied_socket(url, options, proxy) - hostname, unused_port, resource, is_secure = parse_url(url) + hostname, port_from_url, resource, is_secure = parse_url(url) if socket: - return socket, (hostname, int(proxy.proxy_port), resource) + return socket, (hostname, port_from_url, resource) addrinfo_list, need_tunnel, auth = _get_addrinfo_list( - hostname, int(proxy.proxy_port), is_secure, proxy) + hostname, port_from_url, is_secure, proxy) if not addrinfo_list: raise WebSocketException( - "Host not found.: " + hostname + ":" + str(int(proxy.proxy_port))) + "Host not found.: " + hostname + ":" + str(port_from_url)) sock = None try: sock = _open_socket(addrinfo_list, options.sockopt, options.timeout) if need_tunnel: - sock = _tunnel(sock, hostname, int(proxy.proxy_port), auth) + sock = _tunnel(sock, hostname, port_from_url, auth) if is_secure: if HAVE_SSL: @@ -137,7 +137,7 @@ def connect(url, options, proxy, socket): else: raise WebSocketException("SSL not available.") - return sock, (hostname, int(proxy.proxy_port), resource) + return sock, (hostname, port_from_url, resource) except: if sock: sock.close() |