python-websockets / websockets

Library for building WebSocket servers and clients in Python

Home Page:https://websockets.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

receive "message":"Invalid Request."

jw-star opened this issue · comments

            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."}}

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