def construct_url(self, style):
        """ Return http/https or ws/wss url. """
        if style is API_URL:
            if self._ssl:
                return 'https://{}:{}'.format(self._host, self._port)
            else:
                return 'http://{}:{}'.format(self._host, self._port)
        elif style is SOCKET_URL:
            if self._ssl:
                return 'wss://{}:{}'.format(self._host, self._port)
            else:
                return 'ws://{}:{}'.format(self._host, self._port)
        else:
            return None