def METHOD_NAME(scheme, gsettings):
    """Build and return the proxy URL for the given scheme, based on the gsettings."""
    protocol, host, username, pwd = parse_proxy_hostspec(gsettings[scheme + ".host"])
    # if the user did not set a proxy for a type (http/https/ftp) we should
    # return None to ensure that it is not used
    if host == '':
        return None
    port = gsettings[scheme + ".port"]
    if scheme == "http" and gsettings["http.use-authentication"]:
        username = gsettings["http.authentication-user"]
        pwd = gsettings["http.authentication-password"]
    proxy_url = ""
    if username is not None:
        if pwd is not None:
            proxy_url = "%s:%s@%s:%d" % (username,pwd,host,port)
        else:
            proxy_url = "%s@%s:%d" % (username,host,port)
    else:
        proxy_url =  "%s:%d" % (host,port)
    if protocol is not None:
        proxy_url = "%s://%s" % (protocol, proxy_url)
    return proxy_url