connect through socks5 proxy
nagylzs opened this issue · 2 comments
nagylzs commented
I would like to use asyncpg through a socks 5 proxy. I need this because the postgresql instances are running inside a docker overlay network (swarm). The IP addresses of the servers are not fixed, and it is not possible to access them directly.
If I had a single postgres server, then it would not be a problem to manually create a tunnel. But I need to connect to several different servers, and their ip addresses are changing. Manually creating a bunch of host aliases and creating multiple tunnels is just not practical.
Would it be possible to add a layer that would allow me to add my own callback for creating the TCP socket for a given host name + port pair?