fancy-air-28659
03/26/2023, 10:03 AMgentle-ice-1561
03/26/2023, 10:39 AMgentle-ice-1561
03/26/2023, 10:39 AMfancy-air-28659
03/26/2023, 12:01 PMfancy-air-28659
03/26/2023, 12:21 PMfancy-air-28659
03/26/2023, 12:21 PMcpp
LUA_FUNCTION(Test) {
auto http = SteamHTTP();
auto utils = SteamUtils();
auto h = http->CreateHTTPRequest(k_EHTTPMethodGET, "https://rsc-tempx.shuttleapp.rs");
SteamAPICall_t call = 0;
if (http->SendHTTPRequest(h, &call)) {
while (true) {
SteamAPI_RunCallbacks();
bool failed = false;
if (utils->IsAPICallCompleted(call, &failed)) {
if (failed) {
Error("failed\n");
break;
}
HTTPRequestCompleted_t req;
if (utils->GetAPICallResult(call, &req, sizeof(req), HTTPRequestCompleted_t::k_iCallback, &failed)) {
Msg("YES\n");
}
else {
Error("noooo\n");
}
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
else {
Error("fail\n");
}
return 0;
}fancy-air-28659
03/26/2023, 12:22 PMfancy-air-28659
03/26/2023, 12:22 PMfancy-air-28659
03/26/2023, 12:24 PMfancy-air-28659
03/26/2023, 12:25 PMshuttleapp.rs.fancy-air-28659
03/26/2023, 12:35 PMfancy-air-28659
03/27/2023, 2:43 PMgentle-ice-1561
03/27/2023, 3:32 PMfancy-air-28659
03/28/2023, 12:59 PMts
export default async (request: Request, context: Context) => {
const url = new URL(request.url)
if (url.searchParams.has("proxy.domain")) {
const domain = url.searchParams.get("proxy.domain") as string
url.searchParams.delete("proxy.domain")
url.protocol = "https:"
url.host = domain
return fetch(url, request)
.then(response => {
console.log(`${context.ip} ${request.method} ${url} -> ${response.status}`)
return response
})
}
}
Works like a charm. Thank you @gentle-ice-1561 for trying help!