15 lines
380 B
Python
15 lines
380 B
Python
from websockets import *
|
|
import asyncio, json
|
|
|
|
async def msg():
|
|
uri: str = "ws://127.0.0.1:8765"
|
|
async with connect(uri) as websocket:
|
|
send: str = input()
|
|
await websocket.send(send)
|
|
print(f"Client sent {send}")
|
|
response: str = await websocket.recv()
|
|
print(f"Received: {response}")
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(msg())
|