text: import socket 
  import threading
  
  SHUTDOWN_KEY = 'shutdown'
  PASSWORD = 'Test123'
  
  IP = input('Enter IP (empty for default: 0.0.0.0): ')
  PORT = input('Enter port (empty for default: 1337): ')
  separator_token = "<SEP>"
  
  if IP == '': IP = '0.0.0.0'
  if PORT == '': PORT = 1337 
  else: PORT = int(PORT)
  print(f'[!] IP set to: {IP}\n[!] Port set to: {PORT}\n[!] Seperator Token set to: {separator_token}\n')
  
  class ServerNode:
      def __init__(self):
          self.active = True
          print('[*] Starting Initialisation')
          self.sep_token = separator_token
          self.client_sockets = set()
          self.socket = socket.socket()
          self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
          self.socket.bind((IP, PORT))
          self.socket.listen(5)
          print(f'[*] Online\n[!] Listening as {IP}:{PORT}')
  
      def listen_for_client(self, cs):
          while True:
              try:
                  msg = cs.recv(1024).decode()
              except Exception as e:
                  print(f'[!] Error: {e}')
                  self.client_sockets.remove(cs)
                  print(f'[-] {cs} was removed')
              else:
                  msg = msg.replace(separator_token, ": ")
                  if msg == f'{SHUTDOWN_KEY}: {PASSWORD}':
                      self.active = False
                      for cs in self.client_sockets:
                          cs.close()
                      self.socket.close()
              for client_socket in self.client_sockets:
                  if self.active:
                      client_socket.send(msg.encode())
                  else:
                      client_socket.send('[!] Stopping Server'.encode())
  
      def main(self):
          while True:
              if self.active:
                  client_socket, client_address = self.socket.accept()
                  print(f"[+] {client_address} connected.")
                  self.client_sockets.add(client_socket)
                  t = threading.Thread(target=self.listen_for_client, args=(client_socket,))
                  t.daemon = True
                  t.start()
  
          for cs in self.client_sockets:
              cs.close()
          
          self.socket.close()
  
  server = ServerNode()
  server.main()