Skip to content

Instantly share code, notes, and snippets.

@ircfspace
Created September 18, 2025 08:05
Show Gist options
  • Save ircfspace/e3fab304e4db6ea76eb94ee6e230997c to your computer and use it in GitHub Desktop.
Save ircfspace/e3fab304e4db6ea76eb94ee6e230997c to your computer and use it in GitHub Desktop.
Simple GitHub Raw Proxy Worker
export default {
async fetch(request) {
const url = new URL(request.url);
const path = url.pathname.replace(/^\/+/, "");
const parts = path.split("/");
if (parts.length < 4) {
return new Response("Usage: /owner/repo/branch/path/to/file.ext", { status: 400 });
}
const [owner, repo, branch, ...filePathParts] = parts;
const filePath = filePathParts.join("/");
const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filePath}`;
const resp = await fetch(rawUrl);
return new Response(resp.body, {
status: resp.status,
headers: resp.headers,
});
}
};
@hoseinlolready
Copy link

دمت گرم

@shahryarl
Copy link

🙏❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment