'Create a cached instance of a connection to the frontend
user: username to connect as
server: frontend server to connect to
print_log: pring a logging message to stdout on every operation
debug: print out all RPC traffic'

def __init__(self, path, user, server, print_log, debug, reply_debug):

    if (not user):
        user = getpass.getuser()
    if (not server):
        if ('AUTOTEST_WEB' in os.environ):
            server = os.environ['AUTOTEST_WEB']
        else:
            server = settings.get_value('SERVER', 'hostname', default=DEFAULT_SERVER)
    self.server = server
    self.user = user
    self.print_log = print_log
    self.debug = debug
    self.reply_debug = reply_debug
    http_server = ('http://' + server)
    headers = rpc_client_lib.authorization_headers(user, http_server)
    rpc_server = (http_server + path)
    if debug:
        print ('SERVER:    %s' % rpc_server)
        print ('HEADERS:    %s' % headers)
    self.proxy = rpc_client_lib.get_proxy(rpc_server, headers=headers)
