def opened(self):
        """Handler called when the WebSocket connection is opened. The first
        thing to do then is to authenticate ourselves."""
        request = {
            'type': 'authenticate',
            'token': self._token,
            'userAgent': '{} ws4py/{}'.format(version.user_agent,
                                              ws4py.__version__),
        }
        self.send(json.dumps(request))