Add existing project files

This commit is contained in:
ChaoticByte 2025-09-27 07:36:55 +02:00
parent 57efe9201b
commit 58a485f6ee
No known key found for this signature in database
5 changed files with 172 additions and 0 deletions

23
cli_sender.py Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env python3
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:
while True:
inp = input("> ")
await ws.send(inp)
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))