Raw content http proxy for cloudflare workers (GET only). try `https://${ID}.${yourName}.workers.dev/?https://${uri}`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener("fetch", (event) => { | |
const res = handleRequest(event.request) | |
.catch((err) => new Response(err.stack, { status: 500 })) | |
event.respondWith(res); | |
}); | |
/** | |
* @param {FetchEvent} request | |
*/ | |
async function handleRequest(request) { | |
const path = request.url; | |
const index = path.indexOf('dev/?'); | |
if (index) { | |
let res = await fetch(path.slice(index + 5)); | |
return res; | |
} | |
return new Response(null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment