diff --git a/ably/realtime/connection.py b/ably/realtime/connection.py index f698e18d..01f6ea75 100644 --- a/ably/realtime/connection.py +++ b/ably/realtime/connection.py @@ -195,7 +195,7 @@ async def send_protocol_message(self, protocolMessage): async def setup_ws(self): headers = HttpUtils.default_headers() - ws_url = f'wss://{self.options.realtime_host}?key={self.__ably.key}' + ws_url = f'wss://{self.options.get_realtime_host()}?key={self.__ably.key}' log.info(f'setup_ws(): attempting to connect to {ws_url}') async with websockets.connect(ws_url, extra_headers=headers) as websocket: log.info(f'setup_ws(): connection established to {ws_url}')