gateio / gatews

Gate Websocket V4 SDK
89 stars 35 forks source link

WebSocket connection can not be established giving compression error #14

Closed ghost closed 2 years ago

ghost commented 2 years ago

The WebSocket connection can not be established and gives error:

failed to connect to server for the 1 time, try again later: 
Unsupported extension: name = permessage-deflate,
params = [('server_no_context_takeover', None), ('client_no_context_takeover', None)]

Most probably this is due to the new default compression extension since is not specifically specified. Possible solution is to add "compression=None" argument in client.py (line 189) to be like below:

conn = await websockets.connect(self.cfg.host, ssl=ctx, compression=None)

revilwang commented 2 years ago

Thanks for reporting. Which websocket version are you using specifically?

revilwang commented 2 years ago

0.3.1 version has been published to PyPI. Use pip install --upgrade gatews to upgrade to the latest version

ghost commented 2 years ago

Thanks for the fix the implementation. (WebSocket version 10.0)