code: def _client_allowed(self):
      
      client_ip = self._client_address[0]
      if not client_ip in self._settings.allowed_clients and \
         not 'ALL' in self._settings.allowed_clients:
        content = 'Access from host {} forbidden.'.format(client_ip).encode('utf-8')
        self._send_content(content, 'text/html')
        return False
      return True
docs: Check if client is allowed to connect to this server.