Files
5g_drone_ROS2/websocket-client-test.py
2023-05-25 16:25:38 +02:00

13 lines
270 B
Python

#!/usr/bin/env python
import asyncio
from websockets.sync.client import connect
def hello():
with connect("ws://localhost:8765") as websocket:
websocket.send("Hello world!")
message = websocket.recv()
print(f"Received: {message}")
hello()