mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-23 16:38:34 +08:00
init cf worker code
This commit is contained in:
11
test/worker/cf-cdn-cgi-trace.js
Normal file
11
test/worker/cf-cdn-cgi-trace.js
Normal file
@@ -0,0 +1,11 @@
|
||||
export default {
|
||||
async fetch(request, env, ctx) {
|
||||
const url = new URL(request.url);
|
||||
const address = url.searchParams.get("address");
|
||||
if(!address){
|
||||
return new Response('not pass address', { status: 200 });
|
||||
}
|
||||
const resp = fetch(`http://${address}/cdn-cgi/trace`);
|
||||
return new Response((await resp).body, { status: 200 });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user