I currently route many https services through Cloudflare Tunnel; these work really well.
However I’m having a hard time forwarding TCP connections through the tunnel.
I’m running a tunnel in a separate server on AWS.
Currently I forward many http applications though that tunnel.
I have an AWS RDS Postgres database that I’d like to forward through the tunnel as well.
Obviously the Postgres database is a managed database therefore it is not running on the same server where the
tunnel is running.
I tried to set up the tcp connection using the
cloudflared access tcp command as so:
cloudflared access tcp --tunnel-host mytcp.example.com --url thePostgresDbHost.amazon.com:5432
Here’s the error that I get:
2022-10-11T17:58:13Z INF Start Websocket listener host=thePostgresDbHost.amazon.com:5432 2022-10-11T17:58:13Z ERR Error on Websocket listener error="failed to start forwarding server: listen tcp HOST_IP:5432: bind: cannot assign requested address"
HOST_IP is the IP address of the my postgres db hostname
thePostgresDbHost.amazon.com (not the real hostname btw)
Is it possible to forward a tcp connection from a remote host?
I took the example from this Cloudflare blog post here