nk747
nk747
CDCloudflare Developers
Created by nk747 on 4/25/2023 in #workers-help
How can i track how many users are downloading a file?
addEventListener("fetch", event => {
event.respondWith(fetchAndStream(event.request))
});

async function fetchAndStream(request) {
// Fetch from origin server.
let response = await fetch("https://speed.hetzner.de/10GB.bin", request);

return new Response(response.body)
}
addEventListener("fetch", event => {
event.respondWith(fetchAndStream(event.request))
});

async function fetchAndStream(request) {
// Fetch from origin server.
let response = await fetch("https://speed.hetzner.de/10GB.bin", request);

return new Response(response.body)
}
1 replies