summaryrefslogtreecommitdiff
path: root/websocket/_http.py
diff options
context:
space:
mode:
Diffstat (limited to 'websocket/_http.py')
-rw-r--r--websocket/_http.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/websocket/_http.py b/websocket/_http.py
index 29a699c..a8777de 100644
--- a/websocket/_http.py
+++ b/websocket/_http.py
@@ -64,6 +64,7 @@ class proxy_info(object):
self.auth = None
self.no_proxy = None
+
def _open_proxied_socket(url, options, proxy):
hostname, port, resource, is_secure = parse_url(url)
@@ -147,6 +148,10 @@ def _get_addrinfo_list(hostname, port, is_secure, proxy):
return addrinfo_list, False, None
else:
pport = pport and pport or 80
+ # when running on windows 10, the getaddrinfo used above
+ # returns a socktype 0. This generates an error exception:
+ # _on_error: exception Socket type must be stream or datagram, not 0
+ # Force the socket type to SOCK_STREAM
addrinfo_list = socket.getaddrinfo(phost, pport, 0, socket.SOCK_STREAM, socket.SOL_TCP)
return addrinfo_list, True, pauth
except socket.gaierror as e: