- WebsocketProxyException will be raised if we get the proxy error.
This commit is contained in:
liris
2015-02-19 14:42:15 +09:00
parent 1acfdaa24c
commit 48980f28dc
3 changed files with 14 additions and 2 deletions

View File

@@ -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

View File

@@ -544,9 +544,13 @@ class WebSocket(object):
self._send(connect_header) self._send(connect_header)
status, resp_headers = self._read_headers() try:
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()

View File

@@ -56,3 +56,10 @@ class WebSocketTimeoutException(WebSocketException):
""" """
pass pass
class WebSocketProxyException(WebSocketException):
"""
WebSocketProxyException will be raised when proxy error occured.
"""
pass