How to use the websockify.auth_plugins.AuthenticationError function in websockify

To help you get started, we’ve selected a few websockify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github novnc / websockify / websockify / auth_plugins.py View on Github external
def __init__(self, log_msg=None, response_code=403, response_headers={}, response_msg=None):
        self.code = response_code
        self.headers = response_headers
        self.msg = response_msg

        if log_msg is None:
            log_msg = response_msg

        super(AuthenticationError, self).__init__('%s %s' % (self.code, log_msg))
github novnc / websockify / websockify / auth_plugins.py View on Github external
def demand_auth(self):
        raise AuthenticationError(response_code=401,
                                  response_headers={'WWW-Authenticate': 'Basic realm="Websockify"'})
github novnc / websockify / websockify / auth_plugins.py View on Github external
def auth_error(self):
        raise AuthenticationError(response_code=403)