@Override
    protected void configure() {
        withCommand(
            "-c",
            targets
                .entrySet()
                .stream()
                .map(entry -> "socat TCP-LISTEN:" + entry.getKey() + ",fork,reuseaddr TCP:" + entry.getValue())
                .collect(Collectors.joining(" & "))
        );
    }
A socat container is used as a TCP proxy, enabling any TCP port of another container to be exposed
publicly, even if that container does not make the port public itself.
core/src/main/java/org/testcontainers/containers/SocatContainer.java