python-websockets / websockets

Library for building WebSocket servers and clients in Python
https://websockets.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
5.16k stars 513 forks source link

How to custom the message pack for ping pong message #1512

Closed River-Shi closed 1 week ago

River-Shi commented 1 week ago

I’ve read the documentation and know that websockets automatically manages ping-pong. However, exchanges like Bybit require custom ping-pong messages, as shown in the image below.

image

How can I implement that? I know I can using websocket.send(), but is there any way to custome the message and let websockets to handle it automatically?

aaugustin commented 1 week ago

https://websockets.readthedocs.io/en/latest/project/support.html#cryptocurrency-users

River-Shi commented 1 week ago

https://websockets.readthedocs.io/en/latest/project/support.html#cryptocurrency-users

Thanks for replying. I didn't realize you were against BTC.