feat: add Docker network support for sandbox connections - handling host network

This commit is contained in:
TheArtificialQ 2026-07-01 11:03:06 +02:00
parent 3e4372d6f5
commit ab42230f9f

View file

@ -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,