def _client_allowed(self):
    """Check if client is allowed to connect to this server."""
    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
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
Check if client is allowed to connect to this server.