Skip to content

Allow binding to public 0.0.0.0 address #83

@stephenh

Description

@stephenh

I'm running ecsta from within docker/docker-compose, to allow a separate docker-compose service to connect through ecsta to our dev database.

I.e. docker compose up backend-dev boots up the backend-dev service, which is the local backend code but with environment variables of DB_HOST/DB_PORT set to the ecsta service that is also running within docker-compose.

I have this working, but since ecsta only binds to localhost, when ran inside a docker container, nothing from the outside (even other docker services) could connect to it's --local-port.

I was able to use socat to bind to 0.0.0.0:port, have it forward to the localhost:port which ecsta was listening on, and then from there the traffic goes out to the ECS remote port:

#!/bin/bash
set -e

echo "Starting socat to forward 0.0.0.0:$LOCAL_PORT to localhost:$SOCAT_PORT..."
socat TCP-LISTEN:$LOCAL_PORT,bind=0.0.0.0,reuseaddr,fork TCP:localhost:$SOCAT_PORT &

echo "Starting ecsta port forwarding..."
ecsta portforward --region $ECS_REGION --cluster $ECS_CLUSTER --family $ECS_FAMILY --container $ECS_CONTAINER --local-port $SOCAT_PORT --remote-port $REMOTE_PORT

So I'm all set, but just from a simplicity perspective, a command line flag like --public or --local-address=0.0.0.0 would let me remove the socat workaround from our setup.

Thanks for the great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions