diff options
| author | liris <liris.pp@gmail.com> | 2018-05-27 13:38:17 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-27 13:38:17 +0900 |
| commit | 2183d9e4c5860d400ad59037379d6e94fb40aa28 (patch) | |
| tree | a5cd154d0a4124377d09b6c053faa37f6cb58f6d | |
| parent | 708ab4226466680abfeff5530efe437a24ed5766 (diff) | |
| parent | 8cedd88d88505ce13f37d22d5e8e1e097a525685 (diff) | |
| download | websocket-client-2183d9e4c5860d400ad59037379d6e94fb40aa28.tar.gz | |
Merge pull request #427 from element-82/master
_http.py: fix windows proxy error due to socktype
| -rw-r--r-- | websocket/_http.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/websocket/_http.py b/websocket/_http.py index 2f81441..8d82521 100644 --- a/websocket/_http.py +++ b/websocket/_http.py @@ -144,7 +144,11 @@ def _get_addrinfo_list(hostname, port, is_secure, proxy): return addrinfo_list, False, None else: pport = pport and pport or 80 - addrinfo_list = socket.getaddrinfo(phost, pport, 0, 0, socket.SOL_TCP) + # 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: raise WebSocketAddressException(e) |
