Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Websockets help :

hello everyone,

so i've been trying to improve my skill with websockets, i tried to make a listener for chat42.online but no matter what i did i kept getting the same response back.

the code :

async def main():
uri = "wss://chat42.online/ws"
async with websockets.connect(uri=uri) as websocket:

msg = await websocket.recv()
print(f"{msg}")

asyncio.get_event_loop().run_until_complete(main())


i also tried to include the headers but nothing changed, i always get the response: b'\x10\x0c'


any help - clue is appreciated!
by

1 Answer

Bharatv4tg1
I connected to it using wscat (a command line utility to interact with websocket servers), and didn't get any output at all. This might not be a python issue. You might need to send a message before the server will send anything to you.

Login / Signup to Answer the Question.