support a connection callback for proxies

also refactors connection establishment to only go through one method