diff --git a/strix/runtime/session_manager.py b/strix/runtime/session_manager.py index 46c2f21b..b38ba00c 100644 --- a/strix/runtime/session_manager.py +++ b/strix/runtime/session_manager.py @@ -115,9 +115,13 @@ async def create_or_reuse( docker_network=docker_network, ) - caido_endpoint = await session.resolve_exposed_port(_CONTAINER_CAIDO_PORT) - host_caido_url = f"http://{caido_endpoint.host}:{caido_endpoint.port}" - logger.debug("Caido host endpoint resolved: %s", host_caido_url) + if docker_network and docker_network.strip().lower() == "host": + host_caido_url = f"http://127.0.0.1:{_CONTAINER_CAIDO_PORT}" + logger.debug("Caido host endpoint selected for host network: %s", host_caido_url) + else: + caido_endpoint = await session.resolve_exposed_port(_CONTAINER_CAIDO_PORT) + host_caido_url = f"http://{caido_endpoint.host}:{caido_endpoint.port}" + logger.debug("Caido host endpoint resolved: %s", host_caido_url) caido_client = await bootstrap_caido( session,