def onMessage(self, payload, isBinary):
        message = json.loads(payload.decode('utf8'))
        print("Result: {0}".format(message))
        if 'request' in message and message['request']['url'] == "/auth/login":
            # log out
            request = {
                'method': 'POST',
                'url': '/auth/logout',
                'token': message['data']['token']
            }
            self.sendMessage(json.dumps(request).encode('utf8'))
dataset/ETHPy150Open Relrin/aiorest-ws/examples/auth_token/client.py/AuthAPIClientProtocol.onMessage/original