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