mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-22 01:22:21 +08:00
12 lines
387 B
JavaScript
12 lines
387 B
JavaScript
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 });
|
|
}
|
|
};
|