diff --git a/server.py b/server.py index e69de29..21bf242 100644 --- a/server.py +++ b/server.py @@ -0,0 +1,21 @@ +import socket + +HOST = "192.168.0.155" +PORT = 8092 + +s = socket.socket() +s.bind((HOST,PORT)) +print("Listening for upcoming connection") +s.listen() +conn, addr = s.accept() +print(f"Received connection from {addr}") +f = open('encrypt.key', 'wb') +while True: + print("Receiving...") + data = conn.recv(1024) + if data == b"DONE": + break + f.write(data) +f.close() +s.shutdown(2) +s.close()