A repmgr-postgres cluster is usually made up of two (at least, better three) nodes (say A and B), one primary and one standby.
The db is accessible in read/write on the primary node and readonly on the standby(s).
Repmgrd manages the role of each node, and that can varies during the lifespan of the cluster.
So applications that use the db (and they are probably using them in r/w) need to access always the primary but, as we told before, it can be A or B.
Haproxy is a lightweight daemon that should be deployed on the client machine where the the application is running.
If configured properly, continuosly check for the role of A and B, receives pgsql queries from the application and it dispatches them to the primary node.
Hope it helps.