fixed #138
- WebsocketProxyException will be raised if we get the proxy error.
This commit is contained in:
@@ -6,6 +6,7 @@ ChangeLog
|
|||||||
- Supporting http-basic auth in WebSocketApp (#143)
|
- Supporting http-basic auth in WebSocketApp (#143)
|
||||||
- fix failer of test.testInternalRecvStrict(#141)
|
- fix failer of test.testInternalRecvStrict(#141)
|
||||||
- skip utf8 validation by skip_utf8_validation argument (#137)
|
- skip utf8 validation by skip_utf8_validation argument (#137)
|
||||||
|
- WebsocketProxyException will be raised if we got error about proxy.(#138)
|
||||||
|
|
||||||
- 0.23.0
|
- 0.23.0
|
||||||
|
|
||||||
|
@@ -544,9 +544,13 @@ class WebSocket(object):
|
|||||||
|
|
||||||
self._send(connect_header)
|
self._send(connect_header)
|
||||||
|
|
||||||
|
try:
|
||||||
status, resp_headers = self._read_headers()
|
status, resp_headers = self._read_headers()
|
||||||
|
except Exepiton as e:
|
||||||
|
raise WebSocketProxyException(str(e))
|
||||||
|
|
||||||
if status != 200:
|
if status != 200:
|
||||||
raise WebSocketException("failed CONNECT via proxy")
|
raise WebSocketProxyException("failed CONNECT via proxy status: " + str(status))
|
||||||
|
|
||||||
def _get_resp_headers(self, success_status = 101):
|
def _get_resp_headers(self, success_status = 101):
|
||||||
status, resp_headers = self._read_headers()
|
status, resp_headers = self._read_headers()
|
||||||
|
@@ -56,3 +56,10 @@ class WebSocketTimeoutException(WebSocketException):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class WebSocketProxyException(WebSocketException):
|
||||||
|
"""
|
||||||
|
WebSocketProxyException will be raised when proxy error occured.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user