Skip to content

Instantly share code, notes, and snippets.

@3Kmfi6HP
Created June 6, 2023 08:02
Show Gist options
  • Save 3Kmfi6HP/d4b6809ce79fbbe9a993d2312872d4e5 to your computer and use it in GitHub Desktop.
Save 3Kmfi6HP/d4b6809ce79fbbe9a993d2312872d4e5 to your computer and use it in GitHub Desktop.
pages.dev reverse proxy v2ray code
export default {
async fetch(request, env) {
let url = new URL(request.url);
if (url.pathname.startsWith('/')) {
url.hostname="huggingface-node.pages.dev";
let new_request=new Request(url,request);
return fetch(new_request);
}
// Otherwise, serve the static assets.
return env.ASSETS.fetch(request);
}
};

##使用方法

直接上传 pages 然后部署

##Instructions

Upload pages directly and click deploy

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