79219175

Date: 2024-11-24 01:45:50
Score: 1.5
Natty:
Report link

In more recent versions the library's api changed and now they use the argument additional_headers to add new headers:

async def connect():
    async with websockets.connect("wss://site.com/ws", additional_headers=headers) as websocket:
        response = await websocket.recv()
        print(response)

Reference: https://websockets.readthedocs.io/en/stable/reference/asyncio/client.html#opening-a-connection

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: André Duarte