WebSocketBadStatusException: Handshake status 307 - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: WebSocketBadStatusException: Handshake status 307 (/thread-2959.html) |
WebSocketBadStatusException: Handshake status 307 - Susmitha - Apr-21-2017 I am trying to connect to a SignalR hub from python client using "signalr-client-0.0.7".In connection.start() its giving "WebSocketBadStatusException: Handshake status 307".The hub hosted in a remote machine , am using the IP of the server to connect to the hub. ***Please find the callstack Traceback (most recent call last): File "d:\signalrClient.py", line 16, in <module> connection.start() File "D:\Python35-32\lib\site-packages\signalr_client-0.0.7-py3.5.egg\signalr\ _connection.py", line 50, in start File "D:\Python35-32\lib\site-packages\signalr_client-0.0.7-py3.5.egg\signalr\ transports\_auto_transport.py", line 28, in start File "D:\Python35-32\lib\site-packages\signalr_client-0.0.7-py3.5.egg\signalr\ transports\_ws_transport.py", line 38, in start File "D:\Python35-32\lib\site-packages\websocket_client-0.40.0-py3.5.egg\webso cket\_core.py", line 487, in create_connection websock.connect(url, **options) File "D:\Python35-32\lib\site-packages\websocket_client-0.40.0-py3.5.egg\webso cket\_core.py", line 214, in connect self.handshake_response = handshake(self.sock, *addrs, **options) File "D:\Python35-32\lib\site-packages\websocket_client-0.40.0-py3.5.egg\webso cket\_handshake.py", line 65, in handshake status, resp = _get_resp_headers(sock) File "D:\Python35-32\lib\site-packages\websocket_client-0.40.0-py3.5.egg\webso cket\_handshake.py", line 122, in _get_resp_headers raise WebSocketBadStatusException("Handshake status %d", status) websocket._exceptions.WebSocketBadStatusException: Handshake status 307***Am not able to find out why this error is hppening and what this 307 status code corresponds to? Could anyone faced the same issue ? Please share your insights on the issue. Thanks in advance Susmitha RE: WebSocketBadStatusException: Handshake status 307 - Larz60+ - Apr-21-2017 see: http://www.checkupdown.com/status/E307.html RE: WebSocketBadStatusException: Handshake status 307 - Susmitha - Apr-24-2017 HI Larz60+ , Thanks for your reply. In the server side on IIS I enabled URL redirection. I checked the logs on IIS where the first status is 307 then 200 success status.But here as there is no wait while connecting to the hub the first status 307 is returning back I think. And I wrote a C# client for the same and its able to reach the signalr hub and the connection is establishing.In this case also in the logs i can see the status is first 307 then 200. So i dont think i have to do anything on the server side. I tried to use async and await in my scripts to wait till it connect but could not succeed(first time am using this and am new to Python). I used asyncio python module . below is my python client code: Quote:from requests import Session Could you please tell what is wrong here.My intention is to write the script similar to the C# cde below. Quote:var connection = new HubConnection('http://189.70.78.89/Signalr');Regards Susmitha |