dist-iot-net/src/py-cli/websock/alice.py

22 lines
564 B
Python
Executable File

"""
!/usr/bin/env python
https://pypi.org/project/websockets/
@author Lachezar Todorov
"""
import asyncio
import encrypt_decrypt
from websockets import connect
class Alice():
async def messageEncrypt(uri, publicKey, message):
encryptedMessage = encrypt_decrypt.encrypt_decrypt.encryption(message, publicKey)
async with connect(uri) as websocket:
await websocket.send(encryptedMessage)
#message = await websocket.recv()
#print(message)
#asyncio.run(hello("ws://localhost:8765"))