Spaces:
Sleeping
Sleeping
File size: 997 Bytes
5fa74cc bc3aeb9 5fa74cc d113efb ec48066 5fa74cc 83fea52 5fa74cc 83fea52 f97ba53 2b4921b 184c978 2b4921b 5fa74cc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
import asyncio
import websockets
async def send_wss_request():
uri = "wss://clone3-imagex-clone-advance.hf.space/queue/join"
async with websockets.connect(uri) as websocket:
# Receive the response
response = await websocket.recv()
print(f"Received: {response}")
# Send a message
message = '{"fn_index":2,"session_hash":"kb46puzhzr"}'
await websocket.send(message)
print(f"Sent: {message}")
# Receive the response
response = await websocket.recv()
print(f"Received: {response}")
# Send a message
message = '{"data":["spider man",1683852825,8,4,true],"event_data":null,"fn_index":2,"session_hash":"kb46puzhzr"}'
await websocket.send(message)
print(f"Sent: {message}")
# Receive the response
response = await websocket.recv()
print(f"Received: {response}")
# Run the event loop
asyncio.get_event_loop().run_until_complete(send_wss_request()) |