You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following minimal code sample works with websockets==9.1, and raises an exception upon upgrading to websockets==10.
This is a reduced example of code that is currently running and working with websockets==9.1.
I have been able to reproduce this error in a clean virtual environment where the only change is using different versions of the library. I have tested this on Ubuntu 20.04.2 LTS with Python 3.8. The traceback of the error is as follows:
Traceback (most recent call last):
File "main2.py", line 8, in <module>
asyncio.get_event_loop().run_until_complete(main())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "main2.py", line 4, in main
await websockets.connect('wss://testnet.bitmex.com/realtime')
File "/home/jayjay/projects/pyct/venv/lib/python3.8/site-packages/websockets/legacy/client.py", line 649, in __await_impl_timeout__
return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
File "/usr/lib/python3.8/asyncio/tasks.py", line 494, in wait_for
return fut.result()
File "/home/jayjay/projects/pyct/venv/lib/python3.8/site-packages/websockets/legacy/client.py", line 660, in __await_impl__
await protocol.handshake(
File "/home/jayjay/projects/pyct/venv/lib/python3.8/site-packages/websockets/legacy/client.py", line 331, in handshake
self.extensions = self.process_extensions(
File "/home/jayjay/projects/pyct/venv/lib/python3.8/site-packages/websockets/legacy/client.py", line 220, in process_extensions
raise NegotiationError(
websockets.exceptions.NegotiationError: Unsupported extension: name = permessage-deflate, params = [('client_no_context_takeover', None)]
The text was updated successfully, but these errors were encountered:
A server accepts an extension negotiation offer with this parameter
by including the "server_max_window_bits" extension parameter in the
extension negotiation response to send back to the client with the
same or smaller value as the offer.
You can work around this issue by adding compression=None or extensions=[ClientPerMessageDeflateFactory()] to the connect() call.
(I briefly believed this was a bug in websockets, which is why I investigated despite the cryptocurrency policy, but I wasted my time 🤷)
The following minimal code sample works with websockets==9.1, and raises an exception upon upgrading to websockets==10.
This is a reduced example of code that is currently running and working with websockets==9.1.
I have been able to reproduce this error in a clean virtual environment where the only change is using different versions of the library. I have tested this on Ubuntu 20.04.2 LTS with Python 3.8. The traceback of the error is as follows:
The text was updated successfully, but these errors were encountered: