Sets up a proxy for a certain protocol ("http" or "ftp"), calls a function
(that uses the proxy to open a connection) and puts back the previous proxy properties
Applies the authentication properties to the connection, calls a callback function that
uses the connection and puts back the authentication properties to the values that
they had before.