Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect through socks5 proxy #1136

Open
nagylzs opened this issue Mar 16, 2024 · 2 comments
Open

connect through socks5 proxy #1136

nagylzs opened this issue Mar 16, 2024 · 2 comments

Comments

@nagylzs
Copy link

nagylzs commented Mar 16, 2024

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?

@eltoder
Copy link
Contributor

eltoder commented Mar 16, 2024

If you only want a callback functionality and going to implement the proxy handling code yourself, as opposed to having asyngpg natively support socks5, this is similar to #1054

@nagylzs
Copy link
Author

nagylzs commented Mar 16, 2024

I think that would be wonderful, and the cleanest solution. I think we can close this ticket in favour of #1054.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants