def with_target(self, exposed_port: int, host: str, internal_port: Optional[int] = None) -> "SocatContainer":
        """
        Add a target to forward connections from the exposed port to the given host and port.

        Args:
            exposed_port: The port to expose on the container.
            host: The host to forward connections to.
            internal_port: The port on the host to forward connections to. Defaults to the exposed_port if not provided.

        Returns:
            Self: The container instance for chaining.
        """
        if internal_port is None:
            internal_port = exposed_port

        self.with_exposed_ports(exposed_port)
        self.targets[exposed_port] = f"{host}:{internal_port}"
        return self

        Add a target to forward connections from the exposed port to the given host and port.

        Args:
            exposed_port: The port to expose on the container.
            host: The host to forward connections to.
            internal_port: The port on the host to forward connections to. Defaults to the exposed_port if not provided.

        Returns:
            Self: The container instance for chaining.
        
core/testcontainers/socat/socat.py