I have a project using pandas-python to access data from Postgres using SQLAlchemy createngine function. While I pass the credentials and hostname:portname it throws error and asks me to add the machine IP to pg_conf.hba file on the Postgres server. Which will be cumbersome as I don't have a static IP for my machine and even this project need to be shared with other people and it doesn't make any sense to keep on adding new IPs or making requests with ** IPs as it has sensitive data.
Additional information on the topic revealed that actual issue being the
local address he client is using for sending data when talking to the (database) server:
Your client need to use the local VPN address assigned as source address.
This is achieved by adding in a socket.bind(_source address_) call before the call to socket.connect(_target address_).
Or, more conveniently, just provide the source address parameter with the socket.create_connection(address[, timeout[, source_address]]) call that is setting up the connection to the server.
Trying to access Postgres Data within the VPN without adding local machine ip to Postgres Server