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

Allow remote IP address to be overridden #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davel
Copy link

@davel davel commented Apr 29, 2024

Hello,

The postgresql client library provides a "hostaddr" feature, allowing you to override DNS. This is very useful if you wish to use SSL certificate verification but are connecting to your database indirectly.

https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-HOSTADDR

This patch adds this feature. The pq library lacks support (lib/pq#860) so I have implemented here inside the proxy wrapper. Please excuse any terrible Go, I am not a regular user!

All the best,
Dave

@davel davel marked this pull request as ready for review May 10, 2024 16:58
@davel davel changed the title Add hostaddr Allow remote IP address to be overridden May 13, 2024
It is useful to be able to override DNS when connecting to your database.
libpq supports this,

https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-HOSTADDR

however Go's pq library does not, lib/pq#860

We thus implement hostaddr ourselves.
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

Successfully merging this pull request may close these issues.

1 participant