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

receive "message":"Invalid Request." #1420

Closed jw-star closed 10 months ago

jw-star commented 10 months ago
            self.websocket = await websockets.connect(self.ws_url)
            async for message in self.websocket:
                print(f'rec message: {message}')

Why do I receive useless messages at intervals?

rec message: {"id":null,"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid Request."}}
aaugustin commented 10 months ago

For anyone else who stumbles upon this, presumably the answer is "because the server sent these useless messages".