anasraza526's picture
Clean deploy to Hugging Face
ac90985
import asyncio
import websockets
import json
async def test_connection():
uri = "ws://localhost:8000/ws/7"
try:
async with websockets.connect(uri) as websocket:
print(f"Connected to {uri}")
# Register session
await websocket.send(json.dumps({
"type": "register_session",
"session_id": "test-session-123",
"website_id": 7
}))
response = await websocket.recv()
print(f"Received: {response}")
except Exception as e:
print(f"Connection failed: {e}")
if __name__ == "__main__":
asyncio.run(test_connection())