Rename cli_receiver.py to cli_monitor.py to prevent confusion

This commit is contained in:
ChaoticByte 2025-09-27 08:06:36 +02:00
parent 0f470396df
commit 1b244b0c21
No known key found for this signature in database

25
cli_monitor.py Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env python3
# Copyright (c) 2025 Julian Müller (ChaoticByte)
import asyncio
from argparse import ArgumentParser
from websockets.asyncio.client import connect
async def run(host: str, port: int):
async with connect(f"ws://{host}:{port}") as ws:
async for msg in ws:
print(msg)
if __name__ == "__main__":
argp = ArgumentParser()
argp.add_argument("host", type=str, help="Node host to connect to")
argp.add_argument("port", type=int, help="Node port to connect to")
args = argp.parse_args()
asyncio.run(run(args.host, args.port))